IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Client secret not validating

Open MadEddieFFS opened this issue 6 years ago • 5 comments

I previously had IS4 setup and running in a .net core 3 ASP.NET host but recently moved databases. I currently use a SQL database for all IS4 configuration. Within the ClientSecrets table I have a single row for the client which is of type "SharedSecret".

I have an Angular client connecting with PCKE + Code (using angular-oauth2-oidc) where I have used the secret from the table as the "dummyClientSecret" within the angular-oauth2-oidc setup.

Previously this worked but I now receive the following

[21:07:07 DBG] Start parsing Basic Authentication secret

[21:07:07 DBG] Start parsing for secret in post body

[21:07:07 DBG] Parser found secret: PostBodySecretParser

[21:07:07 DBG] Secret id found: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

[21:07:07 DBG] xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx found in database: True

[21:07:07 DBG] client configuration validation for client xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx succeeded.

[21:07:07 DBG] No matching hashed secret found.

[21:07:07 DBG] Secret validators could not validate secret

[21:07:07 INF] {"ClientId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Category": "Authentication", "Name": "Client Authentication Failure", "EventType": "Failure", "Id": 1011, "Message": "Invalid client secret", "ActivityId": "8000001e-0001-f900-b63f-84710c7967bb", "TimeStamp": "2020-01-22T21:07:07.0000000Z", "ProcessId": 6888, "LocalIpAddress": "xx.xx.xx.xx", "RemoteIpAddress": "xx.xx.xx.xx", "$type": "ClientAuthenticationFailureEvent"}

[21:07:07 ERR] Client secret validation failed for client: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.

Could someone help tell me what is wrong with the secret and/or why this validation step is failing.

MadEddieFFS avatar Jan 23 '20 08:01 MadEddieFFS

Don't know - but why are you using a secret at all?

leastprivilege avatar Jan 24 '20 07:01 leastprivilege

Have since stopped using it as I slightly mis-understood the PKCE flow - however I suppose the issue remains

MadEddieFFS avatar Jan 24 '20 21:01 MadEddieFFS

I found a similar issue with the secrets, if they are added as headers then a secret that contains special characters like + and % are deemed not valid. You can work around this with either

  1. Url encoding the secret
  2. Generate a new secret that doesnt have special chars.

hope this helps

morrisond91 avatar Jan 30 '20 12:01 morrisond91

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Questions are community supported only and the authors/maintainers may or may not have time to reply. If you or your company would like commercial support, please see here for more information.

stale[bot] avatar Feb 13 '20 13:02 stale[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Mar 21 '20 20:03 lock[bot]