Skip to content

Commit 0fc34a3

Browse files
authored
Forms : Micro-app update oauth credentials (#507)
1 parent c3d63f5 commit 0fc34a3

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

microapps/FeatureFormsApp/README.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@ for editing Feature attributes.
1010
The application provides a web map gallery and a map viewer which invokes the form when Features are tapped.
1111
Authentication is optional but limited to specific public web maps.
1212

13+
To login to your ArcGIS Online account, click the `Sign in with ArcGIS Online` button in the app. This will open the OAuth page in a new browser window where you can enter the account credentials.
14+
Once you have signed in, you can access the web maps that are shared with your account.
1315

14-
To authenticate using OAuth, provide the Client ID value in `local.properties`. If an OAuth client id
15-
is not provided, the app will prompt a username and password dialog.
16-
17-
```
18-
clientId=YOUR_CLIENT_ID
19-
```
16+
If you'd rather use an ArcGIS Enterprise account, click the `Sign in with ArcGIS Enterprise` button in the app. This will open a dialog prompting for an Enterprise URL followed by another dialog to enter your credentials.
2017

2118
For more information on the `FeatureForm` component and how it works, see it's [Readme](../../toolkit/featureforms/README.md).

microapps/FeatureFormsApp/app/src/main/java/com/arcgismaps/toolkit/featureformsapp/screens/login/LoginViewModel.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class LoginViewModel @Inject constructor(
5757
val loginState = _loginState.asStateFlow()
5858

5959
private val oAuthRedirectUri = "featureformsapp://auth"
60+
private val clientId = "iFmvhJGQEKGK1Ahf"
6061

6162
/**
6263
* Save this url to the search history.
@@ -76,10 +77,10 @@ class LoginViewModel @Inject constructor(
7677
_loginState.value = LoginState.Loading
7778
viewModelScope.launch(Dispatchers.IO) {
7879
authenticatorState.oAuthUserConfiguration =
79-
if (useOAuth && BuildConfig.clientId.isNotBlank())
80+
if (useOAuth)
8081
OAuthUserConfiguration(
8182
portalUrl = url,
82-
clientId = BuildConfig.clientId,
83+
clientId = clientId,
8384
redirectUrl = oAuthRedirectUri,
8485
)
8586
else null

0 commit comments

Comments
 (0)