Class Challenge


  • public class Challenge
    extends java.lang.Object
    Object used with a CredentialProvider to determine which Credentials to use for authentication.
    • Constructor Summary

      Constructors 
      Constructor Description
      Challenge​(java.lang.String realm, java.lang.String host, java.lang.String location, boolean usernamePasswordSupported, boolean hashCredentialSupported, boolean PortalUserTokenSupported, boolean authTokenSupported, int failureCount, int requestId, java.util.Map<Challenge.AuthorizationMethod,​java.util.List<java.lang.String>> realmsMap)  
    • Constructor Detail

      • Challenge

        public Challenge​(java.lang.String realm,
                         java.lang.String host,
                         java.lang.String location,
                         boolean usernamePasswordSupported,
                         boolean hashCredentialSupported,
                         boolean PortalUserTokenSupported,
                         boolean authTokenSupported,
                         int failureCount,
                         int requestId,
                         java.util.Map<Challenge.AuthorizationMethod,​java.util.List<java.lang.String>> realmsMap)
    • Method Detail

      • getRealm

        public java.lang.String getRealm()
        Returns:
        the Realm value associated with the challenge. If the challenge supports multiple auth methods, username/password authorization Realm is returned.
      • getRealms

        public java.util.List<java.lang.String> getRealms​(Challenge.AuthorizationMethod method)
        Parameters:
        method - auth method associated with the challenge.
        Returns:
        list of Realm values for the specified auth method associated with the challenge. If the challenge does not support specified method or the method does not have associated Realm value, empty list is returned.
      • getHost

        public java.lang.String getHost()
        Returns:
        the Host for the credential request.
      • isHashCredentialSupported

        public boolean isHashCredentialSupported()
        A boolean value indicating whether the sender of the challenge can accept hash credentials.
        Returns:
        The return value is true if the sender can accept hash credentials, otherwise false.
      • isPortalUserTokenSupported

        public boolean isPortalUserTokenSupported()
        A boolean value indicating whether the sender of the challenge can accept Portal User Token.
        Returns:
        The return value is true if the sender can accept Portal User Token, otherwise false.
      • getFailureCount

        public int getFailureCount()
        Returns:
        the failure count based on the number of requests.
      • isAuthTokenSupported

        public boolean isAuthTokenSupported()
        A boolean value indicating whether the sender of the challenge can accept OAuth2 Token.
        Returns:
        The return value is true if the sender can accept auth tokens, otherwise false.
      • isUsernamePasswordSupported

        public boolean isUsernamePasswordSupported()
        Is a username/password pair an acceptable response for this challenge?
        Returns:
        The return value is true if username/password are an acceptable response, otherwise false.
      • getLocation

        public java.net.URI getLocation()
        Get location of authorization resource associated with auth token challenge. Credential provider can navigate to this URI using browser window in order to authorize and retrieve auth token for the challenge.
        Returns:
        location of authorization resource associated with auth token challenge.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object