Compare commits

...

2 Commits

Author SHA1 Message Date
Taras Glek 4170d2175a
Merge 7eee61b808 into 6c36f525f9 2025-04-17 06:36:49 +00:00
Taras Glek 7eee61b808 feat(oidc-auth): support empty OIDC client secret 2025-04-17 09:36:17 +03:00
2 changed files with 17 additions and 5 deletions

View File

@ -0,0 +1,5 @@
---
'@hono/oidc-auth': major
---
Support empty OIDC_CLIENT_SECRET

View File

@ -167,11 +167,18 @@ export const getClient = (c: Context): oauth2.Client => {
const env = getOidcAuthEnv(c)
let client = c.get('oidcClient')
if (client === undefined) {
client = {
client_id: env.OIDC_CLIENT_ID,
client_secret: env.OIDC_CLIENT_SECRET,
token_endpoint_auth_method: 'client_secret_basic',
}
client =
env.OIDC_CLIENT_SECRET === ''
? {
// No client secret provided, use 'none' auth method
client_id: env.OIDC_CLIENT_ID,
token_endpoint_auth_method: 'none',
}
: {
client_id: env.OIDC_CLIENT_ID,
client_secret: env.OIDC_CLIENT_SECRET,
token_endpoint_auth_method: 'client_secret_basic',
}
c.set('oidcClient', client)
}
return client