Interface ClientAuthentication
Provides client authentication for the OAuth 2.0 requests,
as per [RFC6749], Section 2.3.
For example:
Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAsBodyParams
(QueryParamsBuilder formBuilder) Sets thisClientAuthentication
as body parameters.void
addAsHeaders
(HttpHeadersBuilder headersBuilder) Sets thisClientAuthentication
as headers.default QueryParams
Returns thisClientAuthentication
as body parameters.default HttpHeaders
Returns thisClientAuthentication
asHttpHeaders
.static ClientAuthentication
ofAuthorization
(String authorizationScheme, String authorization) Returns aClientAuthentication
for the OAuth 2.0 requests based on encoded authorization token and authorization type, as per [RFC6749], Section 2.3.static ClientAuthentication
Returns aClientAuthentication
for the OAuth 2.0 requests based on encoded HTTP basic authorization token, as per [RFC6749], Section 2.3.static ClientAuthentication
ofClientPassword
(String clientId, String clientSecret) Returns aClientAuthentication
for the given client ID and client secret, as per [RFC6749], Section 2.3.1.static ClientAuthentication
ofClientPassword
(String clientId, String clientSecret, boolean useBasicAuth) Returns aClientAuthentication
for the given client ID and client secret, as per [RFC6749], Section 2.3.1.static ClientAuthentication
ofJsonWebToken
(String jsonWebToken) Returns aClientAuthentication
for the given JSON Web Token (JWT), as per [RFC7523], Section 2.2.
-
Method Details
-
ofClientPassword
Returns aClientAuthentication
for the given client ID and client secret, as per [RFC6749], Section 2.3.1. TheClientAuthentication
will be encoded as the HTTP Basic authentication. -
ofClientPassword
static ClientAuthentication ofClientPassword(String clientId, String clientSecret, boolean useBasicAuth) Returns aClientAuthentication
for the given client ID and client secret, as per [RFC6749], Section 2.3.1.Note that if
useBasicAuth
is false, the client ID and client secret will be added as body parameters. -
ofJsonWebToken
Returns aClientAuthentication
for the given JSON Web Token (JWT), as per [RFC7523], Section 2.2. -
ofAuthorization
Returns aClientAuthentication
for the OAuth 2.0 requests based on encoded authorization token and authorization type, as per [RFC6749], Section 2.3.- Parameters:
authorizationScheme
- One of the registered HTTP authentication schemes as per HTTP Authentication Scheme Registry.authorization
- A client authorization token.
-
ofBasic
Returns aClientAuthentication
for the OAuth 2.0 requests based on encoded HTTP basic authorization token, as per [RFC6749], Section 2.3.- Parameters:
authorization
- A client authorization token.
-
addAsHeaders
Sets thisClientAuthentication
as headers.The client authentication can be set via the given
HttpHeadersBuilder
oraddAsBodyParams(QueryParamsBuilder)
. -
asHeaders
Returns thisClientAuthentication
asHttpHeaders
. -
addAsBodyParams
Sets thisClientAuthentication
as body parameters.The client authentication can be set via the given
QueryParamsBuilder
oraddAsHeaders(HttpHeadersBuilder)
. -
asBodyParams
Returns thisClientAuthentication
as body parameters.
-