|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nimbusds.oauth2.sdk.auth.ClientAuthentication
com.nimbusds.oauth2.sdk.auth.ClientSecretBasic
@Immutable public final class ClientSecretBasic
Client secret basic authentication at the Token endpoint. Implements
ClientAuthenticationMethod.CLIENT_SECRET_BASIC
. This class is
immutable.
Example HTTP Authorization header (for client identifier "s6BhdRkqt3" and secret "7Fjfp0ZBr1KtDRbnfVdmIw"):
Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3
Related specifications:
Constructor Summary | |
---|---|
ClientSecretBasic(ClientID clientID,
Secret secret)
Creates a new client secret basic authentication. |
Method Summary | |
---|---|
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). |
ClientID |
getClientID()
Gets the client identifier. |
Secret |
getClientSecret()
Gets the client secret. |
static ClientSecretBasic |
parse(HTTPRequest httpRequest)
Parses a client secret basic authentication from the specified HTTP request. |
static ClientSecretBasic |
parse(String header)
Parses a client secret basic authentication from the specified HTTP Authorization header. |
String |
toHTTPAuthorizationHeader()
Returns the HTTP Authorization header representation of this client secret basic authentication. |
Methods inherited from class com.nimbusds.oauth2.sdk.auth.ClientAuthentication |
---|
getMethod |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClientSecretBasic(ClientID clientID, Secret secret)
clientID
- The client identifier. Must not be null
.secret
- The client secret. Must not be null
.Method Detail |
---|
public ClientID getClientID()
public Secret getClientSecret()
public String toHTTPAuthorizationHeader()
Example HTTP Authorization header (for client identifier "Aladdin" and password "open sesame"):
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
See RFC 2617, section 2.
public void applyTo(HTTPRequest httpRequest)
ClientAuthentication
applyTo
in class ClientAuthentication
httpRequest
- The HTTP request. Must not be null
.public static ClientSecretBasic parse(String header) throws ParseException
header
- The HTTP Authorization header to parse. Must not be
null
.
ParseException
- If the header couldn't be parsed to a client
secret basic authentication.public static ClientSecretBasic parse(HTTPRequest httpRequest) throws ParseException
httpRequest
- The HTTP request to parse. Must not be
null
and must contain a valid
Authorization header.
ParseException
- If the HTTP Authorization header couldn't be
parsed to a client secret basic
authentication.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |