Skip to content

In this SDK, all aspects of ArcGIS and network authentication have been encapsulated into a single ArcGIS Maps SDK for Flutter toolkit component called the Authenticator. This component supports multiple types of authentication challenges, including ArcGIS authentication methods (OAuth and ArcGIS token), Integrated Windows Authentication (IWA), and Client Certificate (PKI). It also provides default user interfaces for login prompts, certificate selection prompts, and server trust dialogs. For example, here is the default UI prompting the user for username and password credentials:

Authenticator login UI to ask for user credentials

Using the Authenticator toolkit component

  1. Integrate the ArcGIS Maps SDK for Flutter Toolkit into your Flutter project by following steps in Install from pub.dev in the toolkit topic.

    Use dark colors for code blocksCopy
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 // Import the ArcGIS Maps SDK for Flutter package. import 'package:arcgis_maps/arcgis_maps.dart';  // Import the ArcGIS Maps SDK for Flutter Toolkit package. import 'package:arcgis_maps_toolkit/arcgis_maps_toolkit.dart'; 
  2. If the Authenticator is going to use OAuth, provide one or more OAuthUserConfiguration(s); otherwise, the user will be prompted to sign in using a username and password to obtain a TokenCredential.

    Use dark colors for code blocksCopy
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 // Define configuration(s) to use when OAuth is requested. // Use your portal to create OAuth credentials and replace // the client ID and redirect URL with your values. // Add to the list if you require more than a single // configuration. final oAuthUserConfigurations = [  OAuthUserConfiguration(  portalUri: Uri.parse('https://www.arcgis.com'),  clientId: 'CLIENT_ID',  redirectUri: Uri.parse('REDIRECT_URL'),  ), ]; 
  3. Place the Authenticator in your application's widget tree as the parent of the ArcGISMapView (or the ArcGISSceneView). If necessary, associate your OAuthUserConfiguration(s).

    Use dark colors for code blocksCopy
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 // Add the Authenticator widget to handle authentication challenges // in your widget tree. child: Authenticator(  // Associate your OAuth user configuration(s) defined earlier.  oAuthUserConfigurations: oAuthUserConfigurations,   // Add an ArcGIS map view widget as the child to the Authenticator,  // and set the ArcGIS map view controller.  child: ArcGISMapView(  controllerProvider: () => mapViewController,  onMapViewReady: onMapViewReady,  ), ), 
  4. During application sign out, you should revoke all tokens and clear all credentials from the credential store.

    Use dark colors for code blocksCopy
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 // Revoke all OAuth tokens. await Authenticator.revokeOAuthTokens();  // Clear all credentials from the credential store. await Authenticator.clearCredentials(); 

To try the Authenticator component, check out the Maps SDK for Flutter Toolkit Example or the Authenticate with OAuth sample.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.