fix: ignore client secret if client is public (#836)

Co-authored-by: James18232 <80368042+James18232@users.noreply.github.com>
This commit is contained in:
James18232
2025-08-17 01:55:32 +10:00
committed by GitHub
parent 17d8893bdb
commit 7b1f6b8857

View File

@@ -1462,8 +1462,8 @@ func (s *OidcService) verifyClientCredentialsInternal(ctx context.Context, tx *g
// Validate credentials based on the authentication method
switch {
// First, if we have a client secret, we validate it
case input.ClientSecret != "":
// First, if we have a client secret, we validate it unless client is marked as public
case input.ClientSecret != "" && !client.IsPublic:
err = bcrypt.CompareHashAndPassword([]byte(client.Secret), []byte(input.ClientSecret))
if err != nil {
return nil, &common.OidcClientSecretInvalidError{}