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, 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 com.nimbusds.openid.connect.sdk.claims.ACR
getACR()
Returns the Authentication Context Class Reference (ACR).List<com.nimbusds.openid.connect.sdk.claims.AMR>
getAMRList()
Returns The Authentication Methods Reference (AMR) list.Date
getAuthTime()
Returns the time of the subject authentication.ClaimsSpec
getClaimsSpec()
Returns the claims specification.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, 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, 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 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 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 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 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.
-
getClaimsSpec
public ClaimsSpec getClaimsSpec()
Returns the claims specification.- Returns:
- The claims 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.
-
-