Class DefaultAuthenticationChallengeHandler

  • All Implemented Interfaces:

    public class DefaultAuthenticationChallengeHandler
    extends Object
    implements AuthenticationChallengeHandler
    Default implementation of the AuthenticationChallengeHandler interface to handle all security types that ArcGIS supports (including OAuth). This should be set on the AuthenticationManager by calling AuthenticationManager.setAuthenticationChallengeHandler(AuthenticationChallengeHandler).
    • If the challenge is an HTTP or token based authentication error, a dialog will prompt the user to enter their credentials.
    • If the challenge is an OAuth based authentication error, a device-installed browser app will be launched to allow OAuth login. There are two additional steps so that OAuth will work correctly in your app: 1. Add an OAuth configuration to the AuthenticationManager with AuthenticationManager.addOAuthConfiguration(OAuthConfiguration), 2. Handle the apps redirect URI with the DefaultOAuthIntentReceiver
    • If the challenge is a self signed certificate error, a dialog will prompt the user to indicate if they want to trust the certificate, as well as if they want the answer to be remembered.
    • If the challenge is a missing client certificate, then a dialog will prompt the user to select a suitable certificate file from the device.
    • Constructor Detail

      • DefaultAuthenticationChallengeHandler

        public DefaultAuthenticationChallengeHandler​( context)
        Constructs a default AuthenticationChallengeHandler, which will use the provided activity for displaying dialogs that allow the user to respond to authentication challenges.
        context - the foreground activity, used for displaying the dialogs
    • Method Detail

      • handleChallenge

        public AuthenticationChallengeResponse handleChallenge​(AuthenticationChallenge challenge)
        Default implementation for handling authentication challenges. Determines the error type and takes the respective action (prompting for credentials if needed, asking to trust server, setup client certificate store, etc.)
        Specified by:
        handleChallenge in interface AuthenticationChallengeHandler
        challenge - the authentication challenge to handle
        the AuthenticationChallengeResponse indicating which action to take