Class AuthenticationChallenge


  • public final class AuthenticationChallenge
    extends java.lang.Object
    Represents an authentication challenge that is presented upon encountering an authentication error. The class contains pertinent information, such as the exception that was raised, the service that was being requested, the credentials used to access them. The challenge will be issued to the current challenge handler, if one has been provided by setting AuthenticationManager.setAuthenticationChallengeHandler(AuthenticationChallengeHandler).

    In Android, a DefaultAuthenticationChallengeHandler is provided for this purpose; if set as the current challenge handler, it will prompt the user for the required information (such as credentials, or whether to trust a server certificate) and then return that information for the request to be retried. The request may also be canceled.

    Since:
    100.0.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  AuthenticationChallenge.Type
      Specifies the different types of authentication challenges that can be raised.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.IOException getException()
      Gets the original authentication exception that was raised by the request.
      int getFailureCount()
      Gets the number of times that the request issuing this challenge has already failed.
      RemoteResource getRemoteResource()
      Gets the RemoteResource that was used to initiate the request.
      java.lang.String getRemoteResourceOwningSystemUrl()
      Returns the owning system URL of the server on which the RemoteResource is running, which can be used to determine if the server is federated by a portal.
      AuthenticationChallenge.Type getType()
      Gets the type of the authentication challenge.
      boolean isPKCESupported()
      Returns a boolean that defines if PKCE (proof key code exchange) is supported with the portal associated with this authentication challenge.
      boolean isRemoteResourceFederated()
      Returns true if the server the RemoteResource runs on is federated to a portal.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getFailureCount

        public int getFailureCount()
        Gets the number of times that the request issuing this challenge has already failed.
        Returns:
        the number of times this request has failed
        Since:
        100.0.0
      • getException

        public java.io.IOException getException()
        Gets the original authentication exception that was raised by the request.
        Returns:
        the original authentication exception
        Since:
        100.0.0
      • getRemoteResource

        public RemoteResource getRemoteResource()
        Gets the RemoteResource that was used to initiate the request.
        Returns:
        the RemoteResource that initiated the request
        Since:
        100.0.0
      • getType

        public AuthenticationChallenge.Type getType()
        Gets the type of the authentication challenge.
        Returns:
        the type of the challenge
        Since:
        100.0.0
      • getRemoteResourceOwningSystemUrl

        public java.lang.String getRemoteResourceOwningSystemUrl()
        Returns the owning system URL of the server on which the RemoteResource is running, which can be used to determine if the server is federated by a portal.
        Returns:
        the owning system URL of the RemoteResource
        Since:
        100.0.0
      • isRemoteResourceFederated

        public boolean isRemoteResourceFederated()
        Returns true if the server the RemoteResource runs on is federated to a portal.
        Returns:
        true if the server is federated, else false
        Since:
        100.0.0
      • isPKCESupported

        public boolean isPKCESupported()
        Returns a boolean that defines if PKCE (proof key code exchange) is supported with the portal associated with this authentication challenge. If this authentication challenge is not associated with a portal, this property returns false.
        Returns:
        a boolean that defines if PKCE is supported with the associated portal
        Since:
        100.12.0