This page is for Authlete 2.x. For current (3.0) documentation, see this page.
Preface
This article describes basics of client authentication configuration in Authlete.How client authentication works in Authlete
Authlete fulfills client authentication on processing token requests (POST /auth/token) based on both pre-configured information and other information obtained at runtime.
Pre-configured information
You will configure both an Authlete service (an API instance acting as a backend of an authorization server) and a client in the service.- Authlete service
- Client
Information obtained at runtime
On receiving a token request from a client, an authorization server passes the content of the request to Authlete’s POST /auth/token API that processes it. Authlete parses the content, detects the identity of the client, determines the pre-specified authentication method, and fulfills client authentication. Some client authentication methods require additional information such as a value of Authorization header in HTTP request from the client to the authorization server, the client’s certificate used in mutual TLS connection between the parties. In such cases, the authorization server extracts those information from the HTTP request or the mutual TLS, and sends it to Authlete, along with the content of the token request.Configuration example
This section shows an example to use CLIENT_SECRET_BASIC method to authenticate a client (ID: 1257…) and fulfill a token request.
The following settings are done in the pre-configuration (Step 0).
-
An service administrator logs in to Authlete’s service owner console, chooses the particular service (“Service A” in this example), and enables support of CLIENT_SECRET_BASIC in Supported Client Authentication Methods setting.
-
On the other side, an client administrator logs in to Authlete’s developer console of the service and specifies CLIENT SECRET_BASIC as the client authentication method for the particular client.
-
CLIENT_SECRET_BASIC requires only “client ID” and “client secret” to authenticate the client. In Authlete, these values are automatically generated (“1257…” and “gTyu…” respectively in this example). The client administrator sets the auto-generated values to the client.
- Step 1
- Step 2
| Item | Value |
|---|---|
| Content of token request | grant_type=authorization_code&code=...&redirect_uri=... |
| Client ID | 1257... |
| Client secret | gTyu... |
- Step 3
- Step 4
Method-specific configuration tips
Both client information to be pre-configured in an Authlete service, and tasks to be done by an authorization server on receiving an token request, are different for each client authentication method. This section describes configuration tips for some of the methods supported by Authlete.CLIENT_SECRET_BASIC
As introduced in the previous section, a client is to set its ID and secret to Authorization header on sending a token request.-
Authlete settings
- You don’t have to configure any additional settings because Authlete automatically generates and manages the client’s ID and secret, which are required for this client authentication method.
-
Authorization server settings
- The server is expected to extract the client’s ID and secret and set them as specific parameters in a request to POST /auth/token.
CLIENT_SECRET_POST
A client is to add its ID and secret to a token request as its parameters.-
Authlete settings
- You don’t have to configure any additional settings, as in the case of CLIENT_SECRET_BASIC above.
-
Authorization server settings
- The server doesn’t have to do any additional operations in terms of the client’s ID and secret because these values are part of the content of the token request.
CLIENT_SECRET_JWT
A client is to generate a JWT assertion that contains a MAC (message authentication code) calculated using the client’s secret, and add it to a token request as its parameters.-
Authlete settings
- While Authlete automatically generates and manages the client’s secret, you have to additionally specify “assertion signing algorithm” of the JWT assertion, as the client’s information in Authlete.
-
Authorization server settings
- The server doesn’t have to do any additional operations in terms of the JWT assertion because the value is part of the content of the token request.
PRIVATE_KEY_JWT
A client is to generate a digitally signed JWT assertion using public key cryptography, and add it to a token request as its parameters.-
Authlete settings
- You have to specify “assertion signing algorithm” of the JWT assertion, as the client’s information in Authlete. The client’s public key also must be registered in advance.
-
Authorization server settings
- The server doesn’t have to do any additional operations in terms of the JWT assertion because the value is part of the content of the token request.
TLS_CLIENT_AUTH
A client is to establish a mutual TLS connection with an authorization server and be authenticated using the client’s certificate obtained from the connection.-
Authlete settings
- You have to specify “subject name” of the client’s certificate, as the client’s information in Authlete.
-
Authorization server settings
- The server has to extract the client’s certificate from the mutual TLS connection and add it as one of request parameters to POST /auth/token.