Package com.nimbusds.oauth2.sdk.auth
Class TLSClientAuthentication
java.lang.Object
com.nimbusds.oauth2.sdk.auth.ClientAuthentication
com.nimbusds.oauth2.sdk.auth.TLSClientAuthentication
- Direct Known Subclasses:
PKITLSClientAuthentication,SelfSignedTLSClientAuthentication
The base abstract class for mutual TLS client authentication at the Token
endpoint.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final X509CertificateThe validated client X.509 certificate from the received HTTPS request,nullfor an outgoing HTTPS request. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTLSClientAuthentication(ClientAuthenticationMethod method, ClientID clientID, X509Certificate certificate) Creates a new abstract mutual TLS client authentication.protectedTLSClientAuthentication(ClientAuthenticationMethod method, ClientID clientID, SSLSocketFactory sslSocketFactory) Creates a new abstract mutual TLS client authentication. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(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).The validated client X.509 certificate from the received HTTPS request.Returns the name of the form parameters, if such are used by the authentication method.Returns the SSL socket factory to use for an outgoing HTTPS request and to present the client certificate(s).Methods inherited from class com.nimbusds.oauth2.sdk.auth.ClientAuthentication
getClientID, getMethod, parse
-
Field Details
-
certificate
The validated client X.509 certificate from the received HTTPS request,nullfor an outgoing HTTPS request.
-
-
Constructor Details
-
TLSClientAuthentication
protected TLSClientAuthentication(ClientAuthenticationMethod method, ClientID clientID, SSLSocketFactory sslSocketFactory) Creates a new abstract mutual TLS client authentication. This constructor is intended for an outgoing token request.- Parameters:
method- The client authentication method. Must not benull.clientID- The client identifier. Must not benull.sslSocketFactory- The SSL socket factory to use for the outgoing HTTPS request and to present the client certificate(s),nullto use the default one.
-
TLSClientAuthentication
protected TLSClientAuthentication(ClientAuthenticationMethod method, ClientID clientID, X509Certificate certificate) Creates a new abstract mutual TLS client authentication. This constructor is intended for a received token request.- Parameters:
method- The client authentication method. Must not benull.clientID- The client identifier. Must not benull.certificate- The validated client X.509 certificate from the received HTTPS request. Should not benull.
-
-
Method Details
-
getSSLSocketFactory
Returns the SSL socket factory to use for an outgoing HTTPS request and to present the client certificate(s).- Returns:
- The SSL socket factory,
nullto use the default one.
-
getClientX509Certificate
The validated client X.509 certificate from the received HTTPS request.- Returns:
- The validated client X.509 certificate from the received
HTTPS request,
nullfor an outgoing HTTPS request.
-
getFormParameterNames
Description copied from class:ClientAuthenticationReturns the name of the form parameters, if such are used by the authentication method.- Specified by:
getFormParameterNamesin classClientAuthentication- Returns:
- The form parameter names, empty set if none.
-
applyTo
Description copied from class:ClientAuthenticationApplies 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:
applyToin classClientAuthentication- Parameters:
httpRequest- The HTTP request. Must not benull.
-