Class AccessTokenValidator.Params
- java.lang.Object
-
- com.authlete.jaxrs.AccessTokenValidator.Params
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- AccessTokenValidator
public static class AccessTokenValidator.Params extends Object implements Serializable
Parameters passed to theAccessTokenValidator.validate(Params)
method.- Since:
- 2.27
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Params()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAccessToken()
Get the access token to validate.String
getClientCertificate()
Get the client certificate presented during the API call to the protected resource endpoint.String
getDpop()
Get the DPoP proof JWT (the value of theDPoP
HTTP header).String
getHtm()
Get the HTTP method of the API call to the protected resource endpoint.String
getHtu()
Get the URL of the protected resource endpoint.String[]
getRequiredScopes()
Get the scopes that must be associated with the access token.String
getRequiredSubject()
Get the subject (= user's unique identifier) that must be associated with the access token.AccessTokenValidator.Params
setAccessToken(String accessToken)
Set the access token to validate.AccessTokenValidator.Params
setClientCertificate(String certificate)
Set the client certificate presented during the API call to the protected resource endpoint.AccessTokenValidator.Params
setDpop(String dpop)
Set the DPoP proof JWT (the value of theDPoP
HTTP header).AccessTokenValidator.Params
setHtm(String htm)
Set the HTTP method of the API call to the protected resource endpoint.AccessTokenValidator.Params
setHtu(String htu)
Set the URL of the protected resource endpoint.AccessTokenValidator.Params
setRequiredScopes(String[] scopes)
Set the scopes that must be associated with the access token.AccessTokenValidator.Params
setRequiredSubject(String subject)
Set the subject (= user's unique identifier) that must be associated with the access token.
-
-
-
Method Detail
-
getAccessToken
public String getAccessToken()
Get the access token to validate.- Returns:
- The access token to validate.
-
setAccessToken
public AccessTokenValidator.Params setAccessToken(String accessToken)
Set the access token to validate.If
null
is given, thevalidate
method will throw aWebApplicationException
.- Parameters:
accessToken
- The access token to validate.- Returns:
this
object.
-
getRequiredScopes
public String[] getRequiredScopes()
Get the scopes that must be associated with the access token.- Returns:
- The scopes that must be associated with the access token.
-
setRequiredScopes
public AccessTokenValidator.Params setRequiredScopes(String[] scopes)
Set the scopes that must be associated with the access token.If a non-null value is given, it will be checked whether the scopes are associated with the access token.
- Parameters:
scopes
- The scopes that must be associated with the access token.- Returns:
this
object.
-
getRequiredSubject
public String getRequiredSubject()
Get the subject (= user's unique identifier) that must be associated with the access token.- Returns:
- The subject that must be associated with the access token.
-
setRequiredSubject
public AccessTokenValidator.Params setRequiredSubject(String subject)
Set the subject (= user's unique identifier) that must be associated with the access token.If a non-null value is given, it will be checked whether the subject is associated with the access token.
- Parameters:
subject
- The subject that must be associated with the access token.- Returns:
this
object.
-
getClientCertificate
public String getClientCertificate()
Get the client certificate presented during the API call to the protected resource endpoint.- Returns:
- The client certificate.
- See Also:
- RFC 8705 : OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens
-
setClientCertificate
public AccessTokenValidator.Params setClientCertificate(String certificate)
Set the client certificate presented during the API call to the protected resource endpoint.If the access token is bound to a client certificate, it will be checked whether the presented client certificate matches the one bound to the access token. See RFC 8705 for details.
- Parameters:
certificate
- The client certificate.- Returns:
this
object.- See Also:
- RFC 8705 : OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens
-
getDpop
public String getDpop()
Get the DPoP proof JWT (the value of theDPoP
HTTP header).- Returns:
- The DPoP proof JWT.
-
setDpop
public AccessTokenValidator.Params setDpop(String dpop)
Set the DPoP proof JWT (the value of theDPoP
HTTP header).If the token type of the access token is DPoP, it will be checked whether the presented DPoP proof JWT is valid for the access token. See "OAuth 2.0 Demonstration of Proof-of-Possession at the Application Layer (DPoP)" for details.
- Parameters:
dpop
- The DPoP proof JWT.- Returns:
this
object.
-
getHtm
public String getHtm()
Get the HTTP method of the API call to the protected resource endpoint.- Returns:
- The HTTP method of the API call to the protected resource
endpoint. For example,
"GET"
.
-
setHtm
public AccessTokenValidator.Params setHtm(String htm)
Set the HTTP method of the API call to the protected resource endpoint.If the token type of the access token is DPoP, it will be checked whether the HTTP method is valid for the presented DPoP proof JWT. See "OAuth 2.0 Demonstration of Proof-of-Possession at the Application Layer (DPoP)" for details.
- Parameters:
htm
- The HTTP method of the API call to the protected resource endpoint. For example,"GET"
.- Returns:
this
object.
-
getHtu
public String getHtu()
Get the URL of the protected resource endpoint.- Returns:
- The URL of the protected resource endpoint.
-
setHtu
public AccessTokenValidator.Params setHtu(String htu)
Set the URL of the protected resource endpoint.If the token type of the access token is DPoP, it will be checked whether the URL is valid for the presented DPoP proof JWT. See "OAuth 2.0 Demonstration of Proof-of-Possession at the Application Layer (DPoP)" for details.
- Parameters:
htu
- The URL of the protected resource endpoint.- Returns:
this
object.
-
-