-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Browser-based applications, which this library is designed for, are to be considered public clients. As such, any client_secret obtained during dynamic client registration is considered non-confidential; it is thus not a secret.
Therefore, the client is considered a Public Client with no Client Secret.
Therefore, token_endpoint_auth_method should be none as recommended by the OIDC spec.
This is then the same token endpoint authentication method as used for a provided client_id that can be dereferenced to a client profile document. In this case, there exists no client_secret at all.
TODO: See...
... in dynamic client registration
| token_endpoint_auth_method: "client_secret_basic", // also works with value "none" if you do not provide "client_secret" on token request |
... in authorization code grant
| client_secret: client_secret, |
... in refresh token grant
| authorization: `Basic ${btoa(`${client_id}:${client_secret}`)}`, |
and remove all usage of client_secret.
Note: This change doesn't reduce security, as the library already correctly implements PKCE (Proof Key for Code Exchange) for the Authorization Code flow. PKCE is the recommended approach for browser-based applications according to OAuth 2.0 Security Best Current Practice. The combination of PKCE with token_endpoint_auth_method: "none" thus represents the current best practice for browser-based clients.