Enum GrantType

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AUTHORIZATION_CODE
      "authorization_code" (1), a grant_type to request an access token and/or an ID token, and optionally a refresh token, using an authorization code.
      CIBA
      "urn:openid:params:grant-type:ciba" (6), a grant_type to request an ID token, an access token, and optionally a refresh token, using a CIBA flow.
      CLIENT_CREDENTIALS
      "client_credentials" (4), a grant_type to request an access token using a client's credentials.
      DEVICE_CODE
      "urn:ietf:params:oauth:grant-type:device_code" (7), a grant_type to request an access token and optionally a refresh token, using Device Flow.
      IMPLICIT
      "implicit" (2), representing Implicit Flow.
      JWT_BEARER
      "urn:ietf:params:oauth:grant-type:jwt-bearer" (9), a grant_type using a JWT as an authorization grant.
      PASSWORD
      "password" (3), a grant_type to request an access token using a resource owner's username and password.
      PRE_AUTHORIZED_CODE
      "urn:ietf:params:oauth:grant-type:pre-authorized_code" (10), a grant_type to request an access token and optionally a refresh token, using Pre-Authorized Code Flow.
      REFRESH_TOKEN
      "refresh_token" (5), a grant_type to request an access token, and optionally an ID token and/or a refresh token, using a refresh token.
      TOKEN_EXCHANGE
      "urn:ietf:params:oauth:grant-type:token-exchange" (8), a grant_type for token exchange.
    • Method Detail

      • values

        public static GrantType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (GrantType c : GrantType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static GrantType valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getValue

        public short getValue()
        Get the integer representation of this enum instance.
      • getVersion

        public Version getVersion()
        Get the Authlete version since which this grant type has been supported.
        Returns:
        The Authlete version since which this grant type has been supported.
        Since:
        3.54
      • getByValue

        public static GrantType getByValue​(short value)
        Find an instance of this enum by a value.
        Parameters:
        value - The integer representation of the instance to find.
        Returns:
        An instance of this enum, or null if not found.
      • parse

        public static GrantType parse​(String grantType)
        Convert String to GrantType.
        Parameters:
        grantType - A grant type. For example, "authorization_code".
        Returns:
        GrantType instance, or null.
      • toArray

        public static GrantType[] toArray​(int bits)