Class TokenRequest


  • public class TokenRequest
    extends ClientAuthnRequest
    Represents a token request to send to the authorization server.
    Version:
    September 30, 2021
    Author:
    Javier Rojas Blum
    • Constructor Detail

      • TokenRequest

        public TokenRequest​(io.jans.as.model.common.GrantType grantType)
        Constructs a token request.
        Parameters:
        grantType - The grant type is mandatory and could be: authorization_code, password, client_credentials, refresh_token.
    • Method Detail

      • getGrantType

        public io.jans.as.model.common.GrantType getGrantType()
        Returns the grant type.
        Returns:
        The grant type.
      • setGrantType

        public void setGrantType​(io.jans.as.model.common.GrantType grantType)
        Sets the grant type.
        Parameters:
        grantType - The grant type.
      • getCode

        public java.lang.String getCode()
        Returns the authorization code.
        Returns:
        The authorization code.
      • setCode

        public void setCode​(java.lang.String code)
        Sets the authorization code.
        Parameters:
        code - The authorization code.
      • getCodeVerifier

        public java.lang.String getCodeVerifier()
        Gets PKCE code verifier.
        Returns:
        code verifier
      • setCodeVerifier

        public void setCodeVerifier​(java.lang.String codeVerifier)
        Sets PKCE code verifier.
        Parameters:
        codeVerifier - code verifier
      • getRedirectUri

        public java.lang.String getRedirectUri()
        Returns the redirect URI.
        Returns:
        The redirect URI.
      • setRedirectUri

        public void setRedirectUri​(java.lang.String redirectUri)
        Sets the redirect URI.
        Parameters:
        redirectUri - The redirect URI.
      • getUsername

        public java.lang.String getUsername()
        Returns the username.
        Returns:
        The username.
      • setUsername

        public void setUsername​(java.lang.String username)
        Sets the username.
        Parameters:
        username - The username.
      • getPassword

        public java.lang.String getPassword()
        Returns the password.
        Returns:
        The password.
      • setPassword

        public void setPassword​(java.lang.String password)
        Sets the password.
        Parameters:
        password - The password.
      • getScope

        public java.lang.String getScope()
        Returns the scope.
        Returns:
        The scope.
      • setScope

        public void setScope​(java.lang.String scope)
        Sets the scope.
        Parameters:
        scope - The scope.
      • getAssertion

        public java.lang.String getAssertion()
        Returns the assertion.
        Returns:
        The assertion.
      • setAssertion

        public void setAssertion​(java.lang.String assertion)
        Sets the assertion.
        Parameters:
        assertion - The assertion.
      • getRefreshToken

        public java.lang.String getRefreshToken()
        Returns the refresh token.
        Returns:
        The refresh token.
      • setRefreshToken

        public void setRefreshToken​(java.lang.String refreshToken)
        Sets the refresh token.
        Parameters:
        refreshToken - The refresh token.
      • getAuthReqId

        public java.lang.String getAuthReqId()
      • setAuthReqId

        public void setAuthReqId​(java.lang.String authReqId)
      • getDeviceCode

        public java.lang.String getDeviceCode()
      • setDeviceCode

        public void setDeviceCode​(java.lang.String deviceCode)
      • getDpop

        public io.jans.as.model.jwt.DPoP getDpop()
      • setDpop

        public void setDpop​(io.jans.as.model.jwt.DPoP dpop)
      • getQueryString

        public java.lang.String getQueryString()
        Returns a query string with the parameters of the authorization request. Any null or empty parameter will be omitted.
        Specified by:
        getQueryString in class BaseRequest
        Returns:
        A query string of parameters.
      • getParameters

        public java.util.Map<java.lang.String,​java.lang.String> getParameters()
        Returns a collection of parameters of the token request. Any null or empty parameter will be omitted.
        Overrides:
        getParameters in class BaseRequest
        Returns:
        A collection of parameters.