Authenticator class

The Authenticator widget handles authentication challenges.

Overview

A user interface is displayed when network and ArcGIS authentication challenges occur.

Features

The Authenticator will handle many different types of authentication, for example:

  • ArcGIS authentication (token and OAuth)
  • Integrated Windows Authentication (IWA)
  • Client Cerfificate (PKI)
  • If credentials were persisted to the keychain, the authenticator will use those instead of requiring the user to re-enter credentials.

Usage

An Authenticator can be placed anywhere in your widget tree, though it makes the most sense to use it as the parent of the ArcGISMapView or ArcGISSceneView widget. It will then handle authentication challenges from loading network resources.

To use OAuth, provide one or more OAuthUserConfigurations in the Authenticator.oAuthUserConfigurations parameter. Otherwise, the user will be prompted to sign in using a username and password to obtain a TokenCredential.

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Authenticator(
        oAuthUserConfigurations: [
          OAauthUserConfiguration(
            portalUri: Uri.parse('https://www.arcgis.com'),
            clientId: 'YOUR-CLIENT-ID',
            redirectUri: Uri.parse('YOUR-REDIRECT-URL'),
          ),
        ],
        child: ArcGISMapView(
          controllerProvider: () => _mapViewController,
        ),
      ),
    );
  }

More information

To learn more about using OAuth with ArcGIS accounts, see: https://developers.arcgis.com/documentation/security-and-authentication/user-authentication/

To configure OAuth for use in your ArcGIS Maps SDK for Flutter app, see: https://developers.arcgis.com/flutter/install-and-set-up/#enabling-user-authentication

Inheritance

Constructors

Authenticator.new({Key? key, Widget? child, List<OAuthUserConfiguration> oAuthUserConfigurations = const []})
Creates an Authenticator widget with the optional child Widget and optional oAuthUserConfigurations.
const

Properties

child Widget?
An optional child widget.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
oAuthUserConfigurations List<OAuthUserConfiguration>
The list of OAuth configurations to use for authentication.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<Authenticator>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

clearCredentials() Future<void>
Clear all credentials from the credential store.
revokeOAuthTokens() Future<void>
Revoke all OAuth tokens. The returned Future completes when all tokens have been successfully revoked.