Class IdentifierAccessToken
- java.lang.Object
-
- com.nimbusds.openid.connect.provider.spi.tokens.IdentifierAccessToken
-
@Immutable public final class IdentifierAccessToken extends Object
Identifier-based access token. The identifier must be sufficiently long and random to make brute force guessing impractical. The value of the access token value may be a direct string representation of the identifier, have some other encoding, or include additional security protection (e.g. HMAC to detect illegal / fake tokens).Sample access token that is a 128 bit random identifier:
NNEYDTdMd2qRiwq-GS6UiQ
Sample access token with the same 128 bit random identifier, protected with HMAC SHA-256 truncated to 128 bits:
NNEYDTdMd2qRiwq-GS6UiQ.ZTOq370aTUQbpljYhJPbHw
-
-
Constructor Summary
Constructors Constructor Description IdentifierAccessToken(com.nimbusds.oauth2.sdk.id.Identifier id)
Creates a new identifier-based access token.IdentifierAccessToken(com.nimbusds.oauth2.sdk.id.Identifier id, String tokenValue)
Creates a new identifier-based access token.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
com.nimbusds.oauth2.sdk.id.Identifier
getIdentifier()
Returns the access token identifier.String
getTokenValue()
Returns the value of the bearer access token.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
IdentifierAccessToken
public IdentifierAccessToken(com.nimbusds.oauth2.sdk.id.Identifier id)
Creates a new identifier-based access token. The token value will be set to the string representation of the specified identifier.- Parameters:
id
- The identifier to use as unique key for the token authorisation in the Connect2id server. Must be sufficiently long and random to make brute force guessing impractical. Must not benull
.
-
IdentifierAccessToken
public IdentifierAccessToken(com.nimbusds.oauth2.sdk.id.Identifier id, String tokenValue)
Creates a new identifier-based access token.- Parameters:
id
- The identifier to use as unique key for the token authorisation in the Connect2id server. Must be sufficiently long and random to make brute force guessing impractical. Must not benull
.tokenValue
- The value of the bearer access token. May represent the string representation of the specified identifier, some other encoding, or include additional security protection (e.g. HMAC to detect illegal / fake tokens). Must not benull
.
-
-
Method Detail
-
getIdentifier
public com.nimbusds.oauth2.sdk.id.Identifier getIdentifier()
Returns the access token identifier.- Returns:
- The access token identifier.
-
getTokenValue
public String getTokenValue()
Returns the value of the bearer access token.- Returns:
- The token value.
-
-