com.nimbusds.oauth2.sdk.auth
Class ClientAuthentication

java.lang.Object
  extended by com.nimbusds.oauth2.sdk.auth.ClientAuthentication
Direct Known Subclasses:
ClientSecretBasic, ClientSecretPost, JWTAuthentication

public abstract class ClientAuthentication
extends Object

Base abstract class for client authentication at the Token endpoint.

Related specifications:

Author:
Vladimir Dzhuvinov

Constructor Summary
protected ClientAuthentication(ClientAuthenticationMethod method)
          Creates a new abstract client authentication.
 
Method Summary
abstract  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).
 ClientAuthenticationMethod getMethod()
          Gets the client authentication method.
static ClientAuthentication parse(HTTPRequest httpRequest)
          Parses the specified HTTP request for a supported client authentication (see ClientAuthenticationMethod).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientAuthentication

protected ClientAuthentication(ClientAuthenticationMethod method)
Creates a new abstract client authentication.

Parameters:
method - The client authentication method. Must not be null.
Method Detail

getMethod

public ClientAuthenticationMethod getMethod()
Gets the client authentication method.

Returns:
The client authentication method.

parse

public static ClientAuthentication parse(HTTPRequest httpRequest)
                                  throws ParseException
Parses the specified HTTP request for a supported client authentication (see ClientAuthenticationMethod). This method is intended to aid parsing of authenticated TokenRequests.

Parameters:
httpRequest - The HTTP request to parse. Must not be null.
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

public abstract void applyTo(HTTPRequest httpRequest)
                      throws SerializeException
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 be null.
Throws:
SerializeException - If the client authentication parameters couldn't be applied to the HTTP request.


Copyright © 2013 NimbusDS. All Rights Reserved.