OAuth Authentication

This sample demonstrates the use of OAuth 2.0 authorization for an ArcGIS Online user login. In this sample the user is prompted to enter their credentials which are then authenticated against the requested resource.

Once the user has been authenticated successfully, the AuthenticationManager stores this information until the user explicitly signs out. You will need an ArcGIS Online login to run this sample (AuthenticationManager will prompt for username and password).

Tip:

Xamarin platforms require the Xamarin.Auth package available at nuget.org.

OAuth login for ArcGIS Online

Instructions

  1. When you run the sample, the app will load a web map that contains premium content.
  2. You will be challenged for an ArcGIS Online login to view that layer (world traffic).
  3. Enter your ArcGIS Online user name and password.
  4. If you authenticate successfully, the traffic layer will display, otherwise the map will contain only the public layers.
  5. You can alter the code to supply OAuth configuration settings specific to your app.

Code


In this topic
  1. Instructions
  2. Code