1

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).

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.