Package io.jans.as.client
Class TokenRequest
java.lang.Object
io.jans.as.client.BaseRequest
io.jans.as.client.ClientAuthnRequest
io.jans.as.client.TokenRequest
Represents a token request to send to the authorization server.
- Version:
- April 25, 2022
- Author:
- Javier Rojas Blum
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTokenRequest(io.jans.as.model.common.GrantType grantType) Constructs a token request. -
Method Summary
Modifier and TypeMethodDescriptionstatic TokenRequest.Builderbuilder()Returns the assertion.Gets authorization detailsgetCode()Returns the authorization code.Gets PKCE code verifier.io.jans.as.model.jwt.DPoPgetDpop()io.jans.as.model.common.GrantTypeReturns the grant type.Returns a collection of parameters of the token request.Returns the password.Returns a query string with the parameters of the authorization request.Returns the redirect URI.Returns the refresh token.Gets request context as base64urlencoded json stringGets request details as base64urlencoded json stringgetScope()Returns the scope.Returns the username.voidsetActorToken(String actorToken) voidsetActorTokenType(String actorTokenType) voidsetAssertion(String assertion) Sets the assertion.voidsetAuthorizationDetails(String authorizationDetails) Sets authorization detailsvoidsetAuthReqId(String authReqId) voidSets the authorization code.voidsetCodeVerifier(String codeVerifier) Sets PKCE code verifier.voidsetDeviceCode(String deviceCode) voidsetDpop(io.jans.as.model.jwt.DPoP dpop) voidsetGrantType(io.jans.as.model.common.GrantType grantType) Sets the grant type.voidsetPassword(String password) Sets the password.voidsetRedirectUri(String redirectUri) Sets the redirect URI.voidsetRefreshToken(String refreshToken) Sets the refresh token.voidsetRequestContext(String requestContext) Sets request context as base64urlencoded json stringvoidsetRequestDetails(String requestDetails) Sets request details as base64urlencoded json stringvoidsetRequestedTokenType(String requestedTokenType) voidSets the scope.voidsetSubjectToken(String subjectToken) voidsetSubjectTokenType(String subjectTokenType) voidsetUsername(String username) Sets the username.static TokenRequest.BuilderMethods inherited from class io.jans.as.client.ClientAuthnRequest
appendClientAuthnToQuery, getAlgorithm, getAudience, getClientAssertion, getCryptoProvider, getFallbackAlgorithm, getKeyId, getSharedKey, setAlgorithm, setAudience, setCryptoProvider, setKeyId, setSharedKeyMethods inherited from class io.jans.as.client.BaseRequest
addCustomParameter, getAuthenticationMethod, getAuthorizationMethod, getAuthPassword, getAuthUsername, getContentType, getCredentials, getCustomParameters, getEncodedCredentials, getEncodedCredentials, getJSONParameters, getMediaType, hasCredentials, setAuthenticationMethod, setAuthorizationMethod, setAuthPassword, setAuthUsername, setContentType, setMediaType
-
Constructor Details
-
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 Details
-
builder
-
umaBuilder
-
getSubjectToken
-
setSubjectToken
-
getSubjectTokenType
-
setSubjectTokenType
-
getActorToken
-
setActorToken
-
getActorTokenType
-
setActorTokenType
-
getRequestedTokenType
-
setRequestedTokenType
-
getRequestContext
Gets request context as base64urlencoded json string- Returns:
- request context as base64urlencoded json string
-
setRequestContext
Sets request context as base64urlencoded json string- Parameters:
requestContext- request context as base64urlencoded json string
-
getRequestDetails
Gets request details as base64urlencoded json string- Returns:
- request details as base64urlencoded json string
-
setRequestDetails
Sets request details as base64urlencoded json string- Parameters:
requestDetails- request details as base64urlencoded json string
-
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
Returns the authorization code.- Returns:
- The authorization code.
-
setCode
Sets the authorization code.- Parameters:
code- The authorization code.
-
getCodeVerifier
Gets PKCE code verifier.- Returns:
- code verifier
-
setCodeVerifier
Sets PKCE code verifier.- Parameters:
codeVerifier- code verifier
-
getRedirectUri
Returns the redirect URI.- Returns:
- The redirect URI.
-
setRedirectUri
Sets the redirect URI.- Parameters:
redirectUri- The redirect URI.
-
getUsername
Returns the username.- Returns:
- The username.
-
setUsername
Sets the username.- Parameters:
username- The username.
-
getPassword
Returns the password.- Returns:
- The password.
-
setPassword
Sets the password.- Parameters:
password- The password.
-
getScope
Returns the scope.- Returns:
- The scope.
-
setScope
Sets the scope.- Parameters:
scope- The scope.
-
getAuthorizationDetails
Gets authorization details- Returns:
- authorization details
-
setAuthorizationDetails
Sets authorization details- Parameters:
authorizationDetails- authorization details
-
getAssertion
Returns the assertion.- Returns:
- The assertion.
-
setAssertion
Sets the assertion.- Parameters:
assertion- The assertion.
-
getRefreshToken
Returns the refresh token.- Returns:
- The refresh token.
-
setRefreshToken
Sets the refresh token.- Parameters:
refreshToken- The refresh token.
-
getAuthReqId
-
setAuthReqId
-
getDeviceCode
-
setDeviceCode
-
getDpop
public io.jans.as.model.jwt.DPoP getDpop() -
setDpop
public void setDpop(io.jans.as.model.jwt.DPoP dpop) -
getQueryString
Returns a query string with the parameters of the authorization request. Anynullor empty parameter will be omitted.- Specified by:
getQueryStringin classBaseRequest- Returns:
- A query string of parameters.
-
getParameters
Returns a collection of parameters of the token request. Anynullor empty parameter will be omitted.- Overrides:
getParametersin classBaseRequest- Returns:
- A collection of parameters.
-