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
@Immutable public class SubjectAuthorization extends GrantAuthorization
OAuth 2.0 / OpenID Connect authorisation produced by aGrantHandler
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
Constructors Constructor Description 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @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>
getAMRList()
Returns The Authentication Methods Reference (AMR) list.@Nullable Date
getAuthTime()
Returns the time of the subject authentication.IDTokenSpec
getIDTokenSpec()
Returns the ID token specification.com.nimbusds.oauth2.sdk.id.Subject
getSubject()
Returns the subject (end-user) identifier.static SubjectAuthorization
parse(String json)
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
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
-
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 Detail
-
getSubject
public com.nimbusds.oauth2.sdk.id.Subject getSubject()
Returns the subject (end-user) identifier.- Returns:
- The subject identifier.
-
getAuthTime
public @Nullable Date 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
public @Nullable com.nimbusds.openid.connect.sdk.claims.ACR 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
public @Nullable List<com.nimbusds.openid.connect.sdk.claims.AMR> 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
public IDTokenSpec getIDTokenSpec()
Returns the ID token specification.- Returns:
- The ID token specification.
-
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 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
public static SubjectAuthorization parse(String json) throws com.nimbusds.oauth2.sdk.ParseException
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.
-
-