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
-
public class TokenRequest extends ClientAuthnRequest
Represents a token request to send to the authorization server.- Version:
- April 25, 2022
- Author:
- Javier Rojas Blum
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TokenRequest.Builder
-
Constructor Summary
Constructors Constructor Description TokenRequest(io.jans.as.model.common.GrantType grantType)
Constructs a token request.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TokenRequest.Builder
builder()
String
getActorToken()
String
getActorTokenType()
String
getAssertion()
Returns the assertion.String
getAuthorizationDetails()
Gets authorization detailsString
getAuthReqId()
String
getCode()
Returns the authorization code.String
getCodeVerifier()
Gets PKCE code verifier.String
getDeviceCode()
io.jans.as.model.jwt.DPoP
getDpop()
io.jans.as.model.common.GrantType
getGrantType()
Returns the grant type.Map<String,String>
getParameters()
Returns a collection of parameters of the token request.String
getPassword()
Returns the password.String
getQueryString()
Returns a query string with the parameters of the authorization request.String
getRedirectUri()
Returns the redirect URI.String
getRefreshToken()
Returns the refresh token.String
getRequestContext()
Gets request context as base64urlencoded json stringString
getRequestDetails()
Gets request details as base64urlencoded json stringString
getRequestedTokenType()
String
getScope()
Returns the scope.String
getSubjectToken()
String
getSubjectTokenType()
String
getUsername()
Returns the username.void
setActorToken(String actorToken)
void
setActorTokenType(String actorTokenType)
void
setAssertion(String assertion)
Sets the assertion.void
setAuthorizationDetails(String authorizationDetails)
Sets authorization detailsvoid
setAuthReqId(String authReqId)
void
setCode(String code)
Sets the authorization code.void
setCodeVerifier(String codeVerifier)
Sets PKCE code verifier.void
setDeviceCode(String deviceCode)
void
setDpop(io.jans.as.model.jwt.DPoP dpop)
void
setGrantType(io.jans.as.model.common.GrantType grantType)
Sets the grant type.void
setPassword(String password)
Sets the password.void
setRedirectUri(String redirectUri)
Sets the redirect URI.void
setRefreshToken(String refreshToken)
Sets the refresh token.void
setRequestContext(String requestContext)
Sets request context as base64urlencoded json stringvoid
setRequestDetails(String requestDetails)
Sets request details as base64urlencoded json stringvoid
setRequestedTokenType(String requestedTokenType)
void
setScope(String scope)
Sets the scope.void
setSubjectToken(String subjectToken)
void
setSubjectTokenType(String subjectTokenType)
void
setUsername(String username)
Sets the username.static TokenRequest.Builder
umaBuilder()
-
Methods inherited from class io.jans.as.client.ClientAuthnRequest
appendClientAuthnToQuery, getAlgorithm, getAudience, getClientAssertion, getCryptoProvider, getFallbackAlgorithm, getKeyId, getSharedKey, setAlgorithm, setAudience, setCryptoProvider, setKeyId, setSharedKey
-
Methods 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
-
-
-
-
Method Detail
-
builder
public static TokenRequest.Builder builder()
-
umaBuilder
public static TokenRequest.Builder umaBuilder()
-
getSubjectToken
public String getSubjectToken()
-
setSubjectToken
public void setSubjectToken(String subjectToken)
-
getSubjectTokenType
public String getSubjectTokenType()
-
setSubjectTokenType
public void setSubjectTokenType(String subjectTokenType)
-
getActorToken
public String getActorToken()
-
setActorToken
public void setActorToken(String actorToken)
-
getActorTokenType
public String getActorTokenType()
-
setActorTokenType
public void setActorTokenType(String actorTokenType)
-
getRequestedTokenType
public String getRequestedTokenType()
-
setRequestedTokenType
public void setRequestedTokenType(String requestedTokenType)
-
getRequestContext
public String getRequestContext()
Gets request context as base64urlencoded json string- Returns:
- request context as base64urlencoded json string
-
setRequestContext
public void setRequestContext(String requestContext)
Sets request context as base64urlencoded json string- Parameters:
requestContext
- request context as base64urlencoded json string
-
getRequestDetails
public String getRequestDetails()
Gets request details as base64urlencoded json string- Returns:
- request details as base64urlencoded json string
-
setRequestDetails
public void setRequestDetails(String requestDetails)
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
public String getCode()
Returns the authorization code.- Returns:
- The authorization code.
-
setCode
public void setCode(String code)
Sets the authorization code.- Parameters:
code
- The authorization code.
-
getCodeVerifier
public String getCodeVerifier()
Gets PKCE code verifier.- Returns:
- code verifier
-
setCodeVerifier
public void setCodeVerifier(String codeVerifier)
Sets PKCE code verifier.- Parameters:
codeVerifier
- code verifier
-
getRedirectUri
public String getRedirectUri()
Returns the redirect URI.- Returns:
- The redirect URI.
-
setRedirectUri
public void setRedirectUri(String redirectUri)
Sets the redirect URI.- Parameters:
redirectUri
- The redirect URI.
-
getUsername
public String getUsername()
Returns the username.- Returns:
- The username.
-
setUsername
public void setUsername(String username)
Sets the username.- Parameters:
username
- The username.
-
getPassword
public String getPassword()
Returns the password.- Returns:
- The password.
-
setPassword
public void setPassword(String password)
Sets the password.- Parameters:
password
- The password.
-
getScope
public String getScope()
Returns the scope.- Returns:
- The scope.
-
setScope
public void setScope(String scope)
Sets the scope.- Parameters:
scope
- The scope.
-
getAuthorizationDetails
public String getAuthorizationDetails()
Gets authorization details- Returns:
- authorization details
-
setAuthorizationDetails
public void setAuthorizationDetails(String authorizationDetails)
Sets authorization details- Parameters:
authorizationDetails
- authorization details
-
getAssertion
public String getAssertion()
Returns the assertion.- Returns:
- The assertion.
-
setAssertion
public void setAssertion(String assertion)
Sets the assertion.- Parameters:
assertion
- The assertion.
-
getRefreshToken
public String getRefreshToken()
Returns the refresh token.- Returns:
- The refresh token.
-
setRefreshToken
public void setRefreshToken(String refreshToken)
Sets the refresh token.- Parameters:
refreshToken
- The refresh token.
-
getAuthReqId
public String getAuthReqId()
-
setAuthReqId
public void setAuthReqId(String authReqId)
-
getDeviceCode
public String getDeviceCode()
-
setDeviceCode
public void setDeviceCode(String deviceCode)
-
getDpop
public io.jans.as.model.jwt.DPoP getDpop()
-
setDpop
public void setDpop(io.jans.as.model.jwt.DPoP dpop)
-
getQueryString
public String getQueryString()
Returns a query string with the parameters of the authorization request. Anynull
or empty parameter will be omitted.- Specified by:
getQueryString
in classBaseRequest
- Returns:
- A query string of parameters.
-
getParameters
public Map<String,String> getParameters()
Returns a collection of parameters of the token request. Anynull
or empty parameter will be omitted.- Overrides:
getParameters
in classBaseRequest
- Returns:
- A collection of parameters.
-
-