Class TokenExchangeAuthorization
- java.lang.Object
-
- com.nimbusds.openid.connect.provider.spi.grants.GrantAuthorization
-
- com.nimbusds.openid.connect.provider.spi.grants.TokenExchangeAuthorization
-
@Immutable public class TokenExchangeAuthorization extends GrantAuthorization
Authorisation produced by aTokenExchangeGrantHandler
.Supported issued token types:
- Access token (
TokenTypeURI.ACCESS_TOKEN
)
- Access token (
-
-
Constructor Summary
Constructors Constructor Description TokenExchangeAuthorization(com.nimbusds.oauth2.sdk.id.Subject subject, com.nimbusds.oauth2.sdk.Scope scope, AccessTokenSpec accessTokenSpec, ClaimsSpec claimsSpec, @Nullable net.minidev.json.JSONObject data)
Creates a new token exchange authorisation specifying the issue of an own (local)access token
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.nimbusds.oauth2.sdk.id.Subject
getSubject()
Returns the subject (end-user) identifier.com.nimbusds.oauth2.sdk.token.TokenTypeURI
getTokenType()
Returns the type of the issued token.static TokenExchangeAuthorization
parse(String json)
Parses a token exchange authorisation from the specified JSON object string.static TokenExchangeAuthorization
parse(net.minidev.json.JSONObject jsonObject)
Parses a token exchange authorisation from the specified JSON object.net.minidev.json.JSONObject
toJSONObject()
Returns a JSON object representation of this authorisation.-
Methods inherited from class com.nimbusds.openid.connect.provider.spi.grants.GrantAuthorization
getAccessTokenSpec, getAudience, getClaimsSpec, getData, getScope
-
-
-
-
Constructor Detail
-
TokenExchangeAuthorization
public TokenExchangeAuthorization(com.nimbusds.oauth2.sdk.id.Subject subject, com.nimbusds.oauth2.sdk.Scope scope, AccessTokenSpec accessTokenSpec, ClaimsSpec claimsSpec, @Nullable net.minidev.json.JSONObject data)
Creates a new token exchange authorisation specifying the issue of an own (local)access token
.- Parameters:
subject
- The subject (end-user) identifier. Must not benull
.scope
- The authorised scope. Must not benull
.accessTokenSpec
- The access token specification. Must not benull
.claimsSpec
- The OpenID claims specification. Must not benull
.data
- Additional data as a JSON object,null
if not specified.
-
-
Method Detail
-
getTokenType
public com.nimbusds.oauth2.sdk.token.TokenTypeURI getTokenType()
Returns the type of the issued token.- Returns:
- The type of the issued token.
-
getSubject
public com.nimbusds.oauth2.sdk.id.Subject getSubject()
Returns the subject (end-user) identifier.- Returns:
- The subject identifier.
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject()
Description copied from class:GrantAuthorization
Returns a JSON object representation of this authorisation.- Overrides:
toJSONObject
in classGrantAuthorization
- Returns:
- The JSON object representation.
-
parse
public static TokenExchangeAuthorization parse(net.minidev.json.JSONObject jsonObject) throws com.nimbusds.oauth2.sdk.ParseException
Parses a token exchange authorisation from the specified JSON object.- Parameters:
jsonObject
- The JSON object to parse. Must not benull
.- Returns:
- The token exchange authorisation.
- Throws:
com.nimbusds.oauth2.sdk.ParseException
- If parsing failed.
-
parse
public static TokenExchangeAuthorization parse(String json) throws com.nimbusds.oauth2.sdk.ParseException
Parses a token exchange authorisation from the specified JSON object string.- Parameters:
json
- The JSON object string to parse. Must not benull
.- Returns:
- The token exchange authorisation.
- Throws:
com.nimbusds.oauth2.sdk.ParseException
- If parsing failed.
-
-