When using a ClientId or ClientSecret that contains non ASCII characters, then a compliant OIDC server will reject the Authorization Header from swagger-ui due to the clientid / clientsecret not being application/x-www-form-urlencoded, trying to interpret the unicode characters as ASCII. https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1
To reproduce...
Open swagger
Authenticate via client_credentials using a ClientSecret that contains § for example.
OIDC server will respond with "invalid client credentials"
Expected behavior
If the OpenAPI specification states an openIdConnectUrl that specifies client_secret_basic, then the basic credentials should be application/x-www-form-urlencoded prior to base64 encoding. For OAuth2 servers, the most compatible option is probably the current behavior.
Q&A (please complete the following information)
Content & configuration
Describe the bug you're encountering
When using a ClientId or ClientSecret that contains non ASCII characters, then a compliant OIDC server will reject the Authorization Header from swagger-ui due to the clientid / clientsecret not being
application/x-www-form-urlencoded
, trying to interpret the unicode characters as ASCII. https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1To reproduce...
§
for example.Expected behavior
If the OpenAPI specification states an
openIdConnectUrl
that specifiesclient_secret_basic
, then the basic credentials should beapplication/x-www-form-urlencoded
prior to base64 encoding. For OAuth2 servers, the most compatible option is probably the current behavior.