How do I create a credentials file?

1910
1
Jump to solution
10-29-2015 10:14 AM
JohnDaues1
New Contributor

I am running the OAuth2Sample app from the arcgis-runtime-samples-android projects. In the code it looks for a credentials file:

if (fileExists(mCredentialsFileName)) { 

How do I create a credentials file? I believe I have all the data for it (username, client id, portal url, password, license key).

0 Kudos
1 Solution

Accepted Solutions
DanO_Neill
Occasional Contributor III

Once you have successfully authenticated the app will create the credentials file for you and allow you the option to use the the save credentials the next time you open the app.

To authenticate:

1. Log into ArcGIS Developers Site

2. Click the applications button in the upper right corner

3. Register a New Application

4. Copy the Client ID from your newly registered application and paste it into the `client_id` string resource in `res/values/strings.xml`.

5. Run the app

Once you successfully authenticate and re-run the app you will be asked if want to Continue with saved credentials.  If you say **Yes** the app will use the credential file it created to authenticate you in the app.  If you say **No** you will be prompted to sign in again.  Be aware that while this sample app creates and caches the credential file it does not encrypt it, it only shows you how to use the credentials file to authenticate a user.  

View solution in original post

0 Kudos
1 Reply
DanO_Neill
Occasional Contributor III

Once you have successfully authenticated the app will create the credentials file for you and allow you the option to use the the save credentials the next time you open the app.

To authenticate:

1. Log into ArcGIS Developers Site

2. Click the applications button in the upper right corner

3. Register a New Application

4. Copy the Client ID from your newly registered application and paste it into the `client_id` string resource in `res/values/strings.xml`.

5. Run the app

Once you successfully authenticate and re-run the app you will be asked if want to Continue with saved credentials.  If you say **Yes** the app will use the credential file it created to authenticate you in the app.  If you say **No** you will be prompted to sign in again.  Be aware that while this sample app creates and caches the credential file it does not encrypt it, it only shows you how to use the credentials file to authenticate a user.  

0 Kudos