mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-21 09:15:55 +03:00
fix: ignore client secret if client is public (#836)
Co-authored-by: James18232 <80368042+James18232@users.noreply.github.com>
This commit is contained in:
@@ -1462,8 +1462,8 @@ func (s *OidcService) verifyClientCredentialsInternal(ctx context.Context, tx *g
|
|||||||
|
|
||||||
// Validate credentials based on the authentication method
|
// Validate credentials based on the authentication method
|
||||||
switch {
|
switch {
|
||||||
// First, if we have a client secret, we validate it
|
// First, if we have a client secret, we validate it unless client is marked as public
|
||||||
case input.ClientSecret != "":
|
case input.ClientSecret != "" && !client.IsPublic:
|
||||||
err = bcrypt.CompareHashAndPassword([]byte(client.Secret), []byte(input.ClientSecret))
|
err = bcrypt.CompareHashAndPassword([]byte(client.Secret), []byte(input.ClientSecret))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, &common.OidcClientSecretInvalidError{}
|
return nil, &common.OidcClientSecretInvalidError{}
|
||||||
|
|||||||
Reference in New Issue
Block a user