Package com.nimbusds.oauth2.sdk.auth
Class ClientAuthentication
java.lang.Object
com.nimbusds.oauth2.sdk.auth.ClientAuthentication
- Direct Known Subclasses:
JWTAuthentication
,PlainClientSecret
,TLSClientAuthentication
Base abstract class for client authentication at the Token endpoint.
Related specifications:
- OAuth 2.0 (RFC 6749)
- JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication and Authorization Grants (RFC 7523)
- OAuth 2.0 Mutual TLS Client Authentication and Certificate Bound Access Tokens (RFC 8705)
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ClientAuthentication
(ClientAuthenticationMethod method, ClientID clientID) Creates a new abstract client authentication. -
Method Summary
Modifier and TypeMethodDescriptionabstract void
applyTo
(HTTPRequest httpRequest) Applies the authentication to the specified HTTP request by setting its Authorization header and/or POST entity-body parameters (according to the implemented client authentication method).Returns the client identifier.Returns the name of the form parameters, if such are used by the authentication method.Returns the client authentication method.static ClientAuthentication
parse
(HTTPRequest httpRequest) Parses the specified HTTP request for a supported client authentication (seeClientAuthenticationMethod
).
-
Constructor Details
-
ClientAuthentication
Creates a new abstract client authentication.- Parameters:
method
- The client authentication method. Must not benull
.clientID
- The client identifier. Must not benull
.
-
-
Method Details
-
getMethod
Returns the client authentication method.- Returns:
- The client authentication method.
-
getClientID
Returns the client identifier.- Returns:
- The client identifier.
-
getFormParameterNames
Returns the name of the form parameters, if such are used by the authentication method.- Returns:
- The form parameter names, empty set if none.
-
parse
Parses the specified HTTP request for a supported client authentication (seeClientAuthenticationMethod
). This method is intended to aid parsing of authenticatedTokenRequest
s.- Parameters:
httpRequest
- The HTTP request to parse. Must not benull
.- Returns:
- The client authentication method,
null
if none or the method is not supported. - Throws:
ParseException
- If the inferred client authentication couldn't be parsed.
-
applyTo
Applies the authentication to the specified HTTP request by setting its Authorization header and/or POST entity-body parameters (according to the implemented client authentication method).- Parameters:
httpRequest
- The HTTP request. Must not benull
.
-