Class GrantAuthorization
- java.lang.Object
-
- com.nimbusds.openid.connect.provider.spi.grants.GrantAuthorization
-
- Direct Known Subclasses:
SubjectAuthorization
,TokenExchangeAuthorization
@Immutable public class GrantAuthorization extends Object
Basic OAuth 2.0 authorisation produced by aGrantHandler
.Required authorisation details:
- The authorised scope.
All other parameters are optional or have suitable defaults.
-
-
Constructor Summary
Constructors Constructor Description GrantAuthorization(com.nimbusds.oauth2.sdk.Scope scope)
Creates a new basic authorisation.GrantAuthorization(com.nimbusds.oauth2.sdk.Scope scope, @Nullable List<com.nimbusds.oauth2.sdk.id.Audience> audList, AccessTokenSpec accessTokenSpec, @Nullable net.minidev.json.JSONObject data)
Deprecated.GrantAuthorization(com.nimbusds.oauth2.sdk.Scope scope, AccessTokenSpec accessTokenSpec, @Nullable net.minidev.json.JSONObject data)
Creates a new basic authorisation.GrantAuthorization(com.nimbusds.oauth2.sdk.Scope scope, AccessTokenSpec accessTokenSpec, ClaimsSpec claimsSpec, @Nullable net.minidev.json.JSONObject data)
Creates a new basic authorisation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AccessTokenSpec
getAccessTokenSpec()
Returns the access token specification.@Nullable List<com.nimbusds.oauth2.sdk.id.Audience>
getAudience()
Deprecated.ClaimsSpec
getClaimsSpec()
Returns the OpenID claims specification.@Nullable net.minidev.json.JSONObject
getData()
Returns the additional data as a JSON object.com.nimbusds.oauth2.sdk.Scope
getScope()
Returns the authorised scope.static GrantAuthorization
parse(String json)
Parses a basic authorisation from the specified JSON object string.static GrantAuthorization
parse(net.minidev.json.JSONObject jsonObject)
Parses a basic authorisation from the specified JSON object.net.minidev.json.JSONObject
toJSONObject()
Returns a JSON object representation of this authorisation.
-
-
-
Constructor Detail
-
GrantAuthorization
public GrantAuthorization(com.nimbusds.oauth2.sdk.Scope scope)
Creates a new basic authorisation.- Parameters:
scope
- The authorised scope values. Must not benull
.
-
GrantAuthorization
public GrantAuthorization(com.nimbusds.oauth2.sdk.Scope scope, AccessTokenSpec accessTokenSpec, @Nullable net.minidev.json.JSONObject data)
Creates a new basic authorisation.- Parameters:
scope
- The authorised scope. Must not benull
.accessTokenSpec
- The access token specification. Must not benull
.data
- Additional data as a JSON object,null
if not specified.
-
GrantAuthorization
public GrantAuthorization(com.nimbusds.oauth2.sdk.Scope scope, AccessTokenSpec accessTokenSpec, ClaimsSpec claimsSpec, @Nullable net.minidev.json.JSONObject data)
Creates a new basic authorisation.- Parameters:
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.
-
GrantAuthorization
@Deprecated public GrantAuthorization(com.nimbusds.oauth2.sdk.Scope scope, @Nullable List<com.nimbusds.oauth2.sdk.id.Audience> audList, AccessTokenSpec accessTokenSpec, @Nullable net.minidev.json.JSONObject data)
Deprecated.Creates a new basic authorisation.- Parameters:
scope
- The authorised scope. Must not benull
.audList
- Explicit audience of the access token,null
if not specified.accessTokenSpec
- The access token specification. Must not benull
.data
- Additional data as a JSON object,null
if not specified.
-
-
Method Detail
-
getScope
public com.nimbusds.oauth2.sdk.Scope getScope()
Returns the authorised scope.- Returns:
- The authorised scope.
-
getAudience
@Deprecated public @Nullable List<com.nimbusds.oauth2.sdk.id.Audience> getAudience()
Deprecated.Returns the explicit audience of the access token.- Returns:
- The audience of the access token,
null
if not specified.
-
getAccessTokenSpec
public AccessTokenSpec getAccessTokenSpec()
Returns the access token specification.- Returns:
- The access token specification.
-
getClaimsSpec
public ClaimsSpec getClaimsSpec()
Returns the OpenID claims specification.- Returns:
- The OpenID claims specification.
-
getData
public @Nullable net.minidev.json.JSONObject getData()
Returns the additional data as a JSON object.- Returns:
- The additional data,
null
if not specified.
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject()
Returns a JSON object representation of this authorisation.- Returns:
- The JSON object representation.
-
parse
public static GrantAuthorization parse(net.minidev.json.JSONObject jsonObject) throws com.nimbusds.oauth2.sdk.ParseException
Parses a basic authorisation from the specified JSON object.- Parameters:
jsonObject
- The JSON object to parse. Must not benull
.- Returns:
- The basic authorisation.
- Throws:
com.nimbusds.oauth2.sdk.ParseException
- If parsing failed.
-
parse
public static GrantAuthorization parse(String json) throws com.nimbusds.oauth2.sdk.ParseException
Parses a basic authorisation from the specified JSON object string.- Parameters:
json
- The JSON object string to parse. Must not benull
.- Returns:
- The basic authorisation.
- Throws:
com.nimbusds.oauth2.sdk.ParseException
- If parsing failed.
-
-