plain-megabyte-75926
07/22/2025, 9:03 AMclient_secret_basic
but not client_secret_post
for the OAuth client credentials flow. Currently, we are using the client_secret_post
method, but should we switch to client_secret_basic
?brief-egg-61061
07/22/2025, 9:03 AMbrief-egg-61061
07/22/2025, 9:03 AMclient_secret_basic
authentication mechanism, you should configure your OAuth2 client to use client_secret_basic
. By default, Ory Hydra and Ory Network clients are set to use client_secret_basic
, which means the client ID and secret are sent in the HTTP Authorization header. If your client is currently set to client_secret_post
, authentication will fail with Swagger UI, as it does not support this method. To resolve this, update your OAuth2 client to use client_secret_basic
as the token_endpoint_auth_method
. You can do this using the Ory CLI or Hydra CLI with the appropriate flag: ory update oauth2-client --token-endpoint-auth-method client_secret_basic
or hydra update client --token-endpoint-auth-method client_secret_basic
This change will ensure compatibility with Swagger UI, as it expects credentials in the HTTP header, not the POST body. If you continue using client_secret_post
, Swagger UI will not be able to authenticate successfully with your OAuth2 server [Client auth fails because Wrong token_endpoint_auth_method](https://www.ory.sh/docs/hydra/debug/token-endpoint-auth-method). In summary: Yes, you should switch to client_secret_basic
if you want to use Swagger UI for the OAuth client credentials flow.plain-megabyte-75926
07/22/2025, 9:05 AMbrief-egg-61061
07/22/2025, 9:05 AMbrief-egg-61061
07/22/2025, 9:05 AMtoken_endpoint_auth_method
parameter, such as client_secret_basic
, client_secret_post
, private_key_jwt
, or none
. The documentation and CLI options only allow specifying one method at a time, and there is no mention of supporting multiple methods for a single client. If you attempt to use a method that is not configured for the client, authentication will fail [Client auth fails because Wrong token_endpoint_auth_method](https://www.ory.sh/docs/hydra/debug/token-endpoint-auth-method). If you need to support multiple authentication methods, you would need to create separate clients, each configured with the desired method.plain-megabyte-75926
07/22/2025, 9:07 AMplain-megabyte-75926
07/22/2025, 9:07 AMbrief-egg-61061
07/22/2025, 9:07 AMbrief-egg-61061
07/22/2025, 9:07 AMclient_secret_post
, you would run: docker-compose -f quickstart.yml exec hydra \ hydra create client \ --endpoint <http://127.0.0.1:4445> \ --grant-type authorization_code,refresh_token \ --response-type code,id_token \ --scope openid,offline_access \ --redirect-uri <http://your-app/callback> \ --token-endpoint-auth-method client_secret_post
Replace client_secret_post
with your desired method (e.g., client_secret_basic
, private_key_jwt
, or none
). The --token-endpoint-auth-method
flag is used to specify the authentication method for the client at the token endpoint [hydra create client options](https://www.ory.sh/docs/hydra/cli/hydra-create-client#options) [GitLab Hydra integration example](https://www.ory.sh/docs/hydra/self-hosted/gitlab). Summary: You set the authentication method for OAuth clients by specifying the --token-endpoint-auth-method
flag when creating the client via the CLI, not directly in the Docker Compose YAML file.