This article addresses invalid_client errors. These errors can occur during an authentication attempt or when requesting a token. Common error messages include:
{
"errorCode": "invalid_client",
"errorSummary": "Invalid value for 'client_id' parameter."
}
{
"error": "invalid_client",
"error_description": "The client secret supplied for a confidential client is invalid."
}
{
"error": "invalid_client",
"error_description": "Client authentication failed. Either the client or the client credentials are invalid."
}
- OAuth 2.0
- OpenID Connect (OIDC)
- API Authentication
- Okta Identity Engine (OIE)
- Classic
This error typically occurs due to one of the following configuration issues:
-
The
client_idorclient_secretprovided in the request is incorrect or does not match the application's configuration. -
The
client_idandclient_secretare not passed correctly in the Authorization Header, or an incorrect client authentication method is used when calling the/tokenendpoint. -
The
/authorizeand/tokenendpoint requests are being sent to different tenants (e.g., one todomain-123.okta.comand the other todomain-456.okta.com). -
The client secret has expired or was revoked.
-
Verify that the
client_idandclient_secretvalues used in the request exactly match the credentials listed in the application's configuration. -
Confirm that the tenant (e.g.,
https://<tenant>.okta.com) is the same for both the/authorizerequest and the/tokenrequest. -
Verify that the correct client authentication method is used when calling the
/tokenendpoint. Theclient_idandclient_secretmust be passed correctly in the Authorization Header. For more details, see the Client Authentication Methods documentation. NOTE: For theclient_secret_basicmethod, the Authorization header uses the following format:Authorization: Basic ${Base64(<client_id>:<client_secret>)}To generate this Base64-encoded string from the command line, use the following command:
echo -n '<client_id>:<client_secret>' | openssl base64 -
If all configurations are correct, the existing secret may be invalid. If this is the case, follow the steps below to generate a new client secret:
-
In the Admin Console, go to Applications -> Applications.
-
Select the target application.
-
Select the General tab.
-
In the Client Secrets section, click Generate New Secret.
-
Update the external application or service configuration/code with the newly generated secret.
-
