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 StringgetAccessToken()Get the access token to validate.StringgetClientCertificate()Get the client certificate presented during the API call to the protected resource endpoint.StringgetDpop()Get the DPoP proof JWT (the value of theDPoPHTTP header).StringgetHtm()Get the HTTP method of the API call to the protected resource endpoint.StringgetHtu()Get the URL of the protected resource endpoint.String[]getRequiredScopes()Get the scopes that must be associated with the access token.StringgetRequiredSubject()Get the subject (= user's unique identifier) that must be associated with the access token.AccessTokenValidator.ParamssetAccessToken(String accessToken)Set the access token to validate.AccessTokenValidator.ParamssetClientCertificate(String certificate)Set the client certificate presented during the API call to the protected resource endpoint.AccessTokenValidator.ParamssetDpop(String dpop)Set the DPoP proof JWT (the value of theDPoPHTTP header).AccessTokenValidator.ParamssetHtm(String htm)Set the HTTP method of the API call to the protected resource endpoint.AccessTokenValidator.ParamssetHtu(String htu)Set the URL of the protected resource endpoint.AccessTokenValidator.ParamssetRequiredScopes(String[] scopes)Set the scopes that must be associated with the access token.AccessTokenValidator.ParamssetRequiredSubject(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
nullis given, thevalidatemethod will throw aWebApplicationException.- Parameters:
accessToken- The access token to validate.- Returns:
thisobject.
-
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:
thisobject.
-
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:
thisobject.
-
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:
thisobject.- 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 theDPoPHTTP header).- Returns:
- The DPoP proof JWT.
-
setDpop
public AccessTokenValidator.Params setDpop(String dpop)
Set the DPoP proof JWT (the value of theDPoPHTTP 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:
thisobject.
-
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:
thisobject.
-
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:
thisobject.
-
-