Class SubjectAuthorization
java.lang.Object
com.nimbusds.openid.connect.provider.spi.grants.GrantAuthorization
com.nimbusds.openid.connect.provider.spi.grants.SubjectAuthorization
- Direct Known Subclasses:
PasswordGrantAuthorization
,SelfIssuedAssertionAuthorization
,ThirdPartyAssertionAuthorization
,TokenExchangeAuthorization
OAuth 2.0 / OpenID Connect authorisation produced by a
GrantHandler
specifying a subject (end-user) and permitting ID token issue.
Required authorisation details:
- The subject (end-user).
- The authorised scope.
All other parameters are optional or have suitable defaults.
-
Constructor Summary
ConstructorDescriptionSubjectAuthorization
(com.nimbusds.oauth2.sdk.id.Subject subject, com.nimbusds.oauth2.sdk.Scope scope, AccessTokenSpec accessTokenSpec, IDTokenSpec idTokenSpec, ClaimsSpec claimsSpec, @Nullable net.minidev.json.JSONObject data) Creates a new authorisation for the specified subject. -
Method Summary
Modifier and TypeMethodDescription@Nullable com.nimbusds.openid.connect.sdk.claims.ACR
getACR()
Returns the Authentication Context Class Reference (ACR).@Nullable List<com.nimbusds.openid.connect.sdk.claims.AMR>
Returns The Authentication Methods Reference (AMR) list.@Nullable Date
Returns the time of the subject authentication.Returns the ID token specification.com.nimbusds.oauth2.sdk.id.Subject
Returns the subject (end-user) identifier.static SubjectAuthorization
Parses a subject authorisation from the specified JSON object string.static SubjectAuthorization
parse
(net.minidev.json.JSONObject jsonObject) Parses a subject authorisation from the specified JSON object.net.minidev.json.JSONObject
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 Details
-
SubjectAuthorization
public SubjectAuthorization(com.nimbusds.oauth2.sdk.id.Subject subject, com.nimbusds.oauth2.sdk.Scope scope, AccessTokenSpec accessTokenSpec, IDTokenSpec idTokenSpec, ClaimsSpec claimsSpec, @Nullable net.minidev.json.JSONObject data) Creates a new authorisation for the specified subject.- Parameters:
subject
- The subject (end-user) identifier. Must not benull
.scope
- The authorised scope values. Must not benull
.accessTokenSpec
- The access token specification. Must not benull
.idTokenSpec
- The ID 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 Details
-
getSubject
Returns the subject (end-user) identifier.- Returns:
- The subject identifier.
-
getAuthTime
Returns the time of the subject authentication.- Returns:
- The time of the subject authentication. If
null
it will be set to now. Applies only if an ID token is issued.
-
getACR
Returns the Authentication Context Class Reference (ACR).- Returns:
- The Authentication Context Class Reference (ACR),
null
if not specified. Applies only if an ID token is issued.
-
getAMRList
Returns The Authentication Methods Reference (AMR) list.- Returns:
- The Authentication Methods Reference (AMR) list,
null
if not specified. Applies only if an ID token is issued.
-
getIDTokenSpec
Returns the ID token specification.- Returns:
- The ID token specification.
-
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 SubjectAuthorization parse(net.minidev.json.JSONObject jsonObject) throws com.nimbusds.oauth2.sdk.ParseException Parses a subject authorisation from the specified JSON object.- Parameters:
jsonObject
- The JSON object to parse. Must not benull
.- Returns:
- The subject authorisation.
- Throws:
com.nimbusds.oauth2.sdk.ParseException
- If parsing failed.
-
parse
Parses a subject authorisation from the specified JSON object string.- Parameters:
json
- The JSON object string to parse. Must not benull
.- Returns:
- The subject authorisation.
- Throws:
com.nimbusds.oauth2.sdk.ParseException
- If parsing failed.
-