public static class TokenValidationResult.Builder extends java.lang.Object
Constructor and Description |
---|
Builder(boolean active)
Creates a new builder object.
|
Modifier and Type | Method and Description |
---|---|
TokenValidationResult |
build()
Builds a new TokenValidationResult from the parameters
previously supplied to the builder.
|
TokenValidationResult.Builder |
setActive(boolean active)
Set the active field of the token validation result.
|
TokenValidationResult.Builder |
setAdditionalProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
Set the optional additionalProperties field of the token validation
result.
|
TokenValidationResult.Builder |
setAudience(java.lang.String audience)
Set the optional audience field of the token validation result.
|
TokenValidationResult.Builder |
setClientId(java.lang.String clientId)
Set the optional clientId field of the token validation result.
|
TokenValidationResult.Builder |
setExpirationTime(long expirationTime,
java.util.concurrent.TimeUnit timeUnit)
Set the optional expirationTime field of the token validation result.
|
TokenValidationResult.Builder |
setIssuedAt(long issuedAt,
java.util.concurrent.TimeUnit timeUnit)
Set the optional issuedAt field of the token validation result.
|
TokenValidationResult.Builder |
setNotUsedBefore(long notUsedBefore,
java.util.concurrent.TimeUnit timeUnit)
Set the optional notUsedBefore field of the token validation result.
|
TokenValidationResult.Builder |
setScope(java.util.Set<java.lang.String> scope)
Set the optional scope field of the token validation result.
|
TokenValidationResult.Builder |
setSubjectToken(java.lang.String subjectToken)
Set the optional subjectToken field of the token validation result.
|
TokenValidationResult.Builder |
setTokenIdentifier(java.lang.String tokenIdentifier)
Set the optional tokenIdentifier field of the token validation result.
|
TokenValidationResult.Builder |
setTokenType(java.lang.String tokenType)
Set the optional tokenType field of the token validation result.
|
TokenValidationResult.Builder |
setUsername(java.lang.String username)
Set the optional username field of the token validation result.
|
public Builder(boolean active)
active
- true if the token is active, false if not. Per RFC 7662,
a value of true for this property indicates that the given
token was issued by the Token Validator's associated
authorization server, has not been revoked by the resource
owner, and is within its given time window of validity
(e.g. after its issuance time and before its expiration
time).public TokenValidationResult.Builder setActive(boolean active)
active
- true if the token is active, false if not. Per RFC 7662,
a value of true for this property indicates that the given
token was issued by the Token Validator's associated
authorization server, has not been revoked by the resource
owner, and is within its given time window of validity
(e.g. after its issuance time and before its expiration
time).public TokenValidationResult.Builder setScope(java.util.Set<java.lang.String> scope)
scope
- A list of strings representing the scopes associated with
this token.public TokenValidationResult.Builder setClientId(java.lang.String clientId)
clientId
- Client identifier for the OAuth 2.0 client that
requested this token.public TokenValidationResult.Builder setUsername(java.lang.String username)
username
- Human-readable identifier for the resource owner who
authorized this token.public TokenValidationResult.Builder setTokenType(java.lang.String tokenType)
tokenType
- Type of the token as defined in section 5.1 of OAuth
2.0 [RFC6749].public TokenValidationResult.Builder setExpirationTime(long expirationTime, java.util.concurrent.TimeUnit timeUnit)
expirationTime
- Integer timestamp, measured in the number of
time units since January 1 1970 UTC, indicating
when this token will expire.timeUnit
- the time units of the specified expiration time.public TokenValidationResult.Builder setIssuedAt(long issuedAt, java.util.concurrent.TimeUnit timeUnit)
issuedAt
- Integer timestamp, measured in the number of time
units since January 1 1970 UTC, indicating when this
token was originally issued.timeUnit
- the time units of the specified issuedAt time.public TokenValidationResult.Builder setNotUsedBefore(long notUsedBefore, java.util.concurrent.TimeUnit timeUnit)
notUsedBefore
- Integer timestamp, measured in the number of
time units since January 1 1970 UTC, indicating
when this token is not to be used before.timeUnit
- the time units of the specified notUsedBefore time.public TokenValidationResult.Builder setSubjectToken(java.lang.String subjectToken)
subjectToken
- Subject of the token, as defined in JWT [RFC7519].
This value should contain the subject ID as known to
the Broker rather than the external authorization
server. It is the responsibility of the Token
Validator to translate an external subject
identifier into the Broker's syntax. The Broker uses
a relative resource path as the subject ID, e.g.
"Users/user_id", where user_id is the value of the
subject's SCIM id property.public TokenValidationResult.Builder setAudience(java.lang.String audience)
audience
- Service-specific string identifier representing the
intended audience for this token, as defined in
JWT [RFC7519].public TokenValidationResult.Builder setTokenIdentifier(java.lang.String tokenIdentifier)
tokenIdentifier
- Unique string identifier for the token, as
defined in section 4.1.7 of JWT [RFC7519].public TokenValidationResult.Builder setAdditionalProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
properties
- Map of property names to values, containing any
extension values implemented by the
AccessTokenValidator.public TokenValidationResult build()