Package com.nimbusds.oauth2.sdk
Class TokenIntrospectionSuccessResponse.Builder
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.TokenIntrospectionSuccessResponse.Builder
-
- Enclosing class:
- TokenIntrospectionSuccessResponse
public static class TokenIntrospectionSuccessResponse.Builder extends Object
Builder for constructing token introspection success responses.
-
-
Constructor Summary
Constructors Constructor Description Builder(boolean active)
Creates a new token introspection success response builder.Builder(TokenIntrospectionSuccessResponse response)
Creates a new token introspection success response builder with the parameters of the specified response.
-
Method Summary
-
-
-
Constructor Detail
-
Builder
public Builder(boolean active)
Creates a new token introspection success response builder.- Parameters:
active
-true
if the token is active, elsefalse
.
-
Builder
public Builder(TokenIntrospectionSuccessResponse response)
Creates a new token introspection success response builder with the parameters of the specified response.- Parameters:
response
- The response which parameters to use. Notnull
.
-
-
Method Detail
-
scope
public TokenIntrospectionSuccessResponse.Builder scope(Scope scope)
Sets the token scope.- Parameters:
scope
- The token scope,null
if not specified.- Returns:
- This builder.
-
clientID
public TokenIntrospectionSuccessResponse.Builder clientID(ClientID clientID)
Sets the identifier for the OAuth 2.0 client that requested the token.- Parameters:
clientID
- The client identifier,null
if not specified.- Returns:
- This builder.
-
username
public TokenIntrospectionSuccessResponse.Builder username(String username)
Sets the username of the resource owner who authorised the token.- Parameters:
username
- The username,null
if not specified.- Returns:
- This builder.
-
tokenType
public TokenIntrospectionSuccessResponse.Builder tokenType(AccessTokenType tokenType)
Sets the token type.- Parameters:
tokenType
- The token type,null
if not specified.- Returns:
- This builder.
-
expirationTime
public TokenIntrospectionSuccessResponse.Builder expirationTime(Date exp)
Sets the token expiration time.- Parameters:
exp
- The token expiration time,null
if not specified.- Returns:
- This builder.
-
issueTime
public TokenIntrospectionSuccessResponse.Builder issueTime(Date iat)
Sets the token issue time.- Parameters:
iat
- The token issue time,null
if not specified.- Returns:
- This builder.
-
notBeforeTime
public TokenIntrospectionSuccessResponse.Builder notBeforeTime(Date nbf)
Sets the token not-before time.- Parameters:
nbf
- The token not-before time,null
if not specified.- Returns:
- This builder.
-
subject
public TokenIntrospectionSuccessResponse.Builder subject(Subject sub)
Sets the token subject.- Parameters:
sub
- The token subject,null
if not specified.- Returns:
- This builder.
-
audience
public TokenIntrospectionSuccessResponse.Builder audience(List<Audience> audList)
Sets the token audience.- Parameters:
audList
- The token audience,null
if not specified.- Returns:
- This builder.
-
issuer
public TokenIntrospectionSuccessResponse.Builder issuer(Issuer iss)
Sets the token issuer.- Parameters:
iss
- The token issuer,null
if not specified.- Returns:
- This builder.
-
jwtID
public TokenIntrospectionSuccessResponse.Builder jwtID(JWTID jti)
Sets the token identifier.- Parameters:
jti
- The token identifier,null
if not specified.- Returns:
- This builder.
-
x509CertificateSHA256Thumbprint
@Deprecated public TokenIntrospectionSuccessResponse.Builder x509CertificateSHA256Thumbprint(com.nimbusds.jose.util.Base64URL x5t)
Deprecated.Sets the client X.509 certificate SHA-256 thumbprint, for a mutual TLS client certificate bound access token. Corresponds to thecnf.x5t#S256
claim.- Parameters:
x5t
- The client X.509 certificate SHA-256 thumbprint,null
if not specified.- Returns:
- This builder.
-
x509CertificateConfirmation
public TokenIntrospectionSuccessResponse.Builder x509CertificateConfirmation(X509CertificateConfirmation cnf)
Sets the client X.509 certificate confirmation, for a mutual TLS client certificate bound access token. Corresponds to thecnf.x5t#S256
claim.- Parameters:
cnf
- The client X.509 certificate confirmation,null
if not specified.- Returns:
- This builder.
-
parameter
public TokenIntrospectionSuccessResponse.Builder parameter(String name, Object value)
Sets a custom parameter.- Parameters:
name
- The parameter name. Must not benull
.value
- The parameter value. Should map to a JSON type. Ifnull
not specified.- Returns:
- This builder.
-
build
public TokenIntrospectionSuccessResponse build()
Builds a new token introspection success response.- Returns:
- The token introspection success response.
-
-