Package com.nimbusds.oauth2.sdk.auth
Class ClientSecretPost
java.lang.Object
com.nimbusds.oauth2.sdk.auth.ClientAuthentication
com.nimbusds.oauth2.sdk.auth.PlainClientSecret
com.nimbusds.oauth2.sdk.auth.ClientSecretPost
Client secret post authentication at the Token endpoint. Implements
ClientAuthenticationMethod.CLIENT_SECRET_POST
.
Related specifications:
- OAuth 2.0 (RFC 6749)
- OpenID Connect Core 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionClientSecretPost
(ClientID clientID, Secret secret) Creates a new client secret post authentication. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 name of the form parameters, if such are used by the authentication method.static ClientSecretPost
parse
(HTTPRequest httpRequest) Parses a client secret post authentication from the specified HTTP POST request.static ClientSecretPost
Parses a client secret post authentication from the specifiedapplication/x-www-form-urlencoded
encoded parameters string.static ClientSecretPost
Parses a client secret post authentication from the specified parameters map.Returns the parameter representation of this client secret post authentication.Methods inherited from class com.nimbusds.oauth2.sdk.auth.PlainClientSecret
getClientSecret
Methods inherited from class com.nimbusds.oauth2.sdk.auth.ClientAuthentication
getClientID, getMethod
-
Constructor Details
-
ClientSecretPost
Creates a new client secret post authentication.- Parameters:
clientID
- The client identifier. Must not benull
.secret
- The client secret. Must not benull
.
-
-
Method Details
-
getFormParameterNames
Description copied from class:ClientAuthentication
Returns the name of the form parameters, if such are used by the authentication method.- Specified by:
getFormParameterNames
in classClientAuthentication
- Returns:
- The form parameter names, empty set if none.
-
toParameters
Returns the parameter representation of this client secret post authentication. Note that the parameters are notapplication/x-www-form-urlencoded
encoded.Parameters map:
"client_id" = [client-identifier] "client_secret" = [client-secret]
- Returns:
- The parameters map, with keys "client_id" and "client_secret".
-
applyTo
Description copied from class:ClientAuthentication
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).- Specified by:
applyTo
in classClientAuthentication
- Parameters:
httpRequest
- The HTTP request. Must not benull
.
-
parse
Parses a client secret post authentication from the specified parameters map. Note that the parameters must not beapplication/x-www-form-urlencoded
encoded.- Parameters:
params
- The parameters map to parse. The client secret post parameters must be keyed under "client_id" and "client_secret". The map must not benull
.- Returns:
- The client secret post authentication.
- Throws:
ParseException
- If the parameters map couldn't be parsed to a client secret post authentication.
-
parse
Parses a client secret post authentication from the specifiedapplication/x-www-form-urlencoded
encoded parameters string.- Parameters:
paramsString
- The parameters string to parse. The client secret post parameters must be keyed under "client_id" and "client_secret". The string must not benull
.- Returns:
- The client secret post authentication.
- Throws:
ParseException
- If the parameters string couldn't be parsed to a client secret post authentication.
-
parse
Parses a client secret post authentication from the specified HTTP POST request.- Parameters:
httpRequest
- The HTTP POST request to parse. Must not benull
and must contain a validapplication/x-www-form-urlencoded
encoded parameters string in the entity body. The client secret post parameters must be keyed under "client_id" and "client_secret".- Returns:
- The client secret post authentication.
- Throws:
ParseException
- If the HTTP request header couldn't be parsed to a valid client secret post authentication.
-