Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Web Key Store default keys broken after upgrading to beta.6 #921

Closed
Entrio opened this issue Jul 12, 2018 · 5 comments
Closed

JSON Web Key Store default keys broken after upgrading to beta.6 #921

Entrio opened this issue Jul 12, 2018 · 5 comments

Comments

@Entrio
Copy link

Entrio commented Jul 12, 2018

Do you want to request a feature or report a bug?
Report a bug

What is the current behavior?
Hydra does not startup

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
Perform a migration from b4->b6

What is the expected behavior?
Hydra should startup )

Which version of the software is affected?
hydra b6

In the error log I get the following error:

time="2018-07-12T09:04:49+06:00" level=fatal msg="Unable to refresh OpenID Connect signing keys." error="public and private key pair kids do not match"

@aeneasr
Copy link
Member

aeneasr commented Jul 12, 2018

I think the issue is that the new generator expects the keys from the JSON Web Key storage to have matching public/private kids. This wasn't the case before and the strategy had a bug which caused the keys to mismatch. Can you sign into the db and run:

DELETE FROM hydra_jwk WHERE sid='hydra.https-tls' OR sid='hydra.openid.id-token'

@Entrio
Copy link
Author

Entrio commented Jul 12, 2018

After performing those queries, hydra generated new keys but my client now fails to authenticate with the following error:
Client supports client authentication method "client_secret_basic", but method "client_secret_post" was requested.

@aeneasr
Copy link
Member

aeneasr commented Jul 12, 2018

See: https://github.com/ory/hydra/blob/master/UPGRADE.md#oauth-20-clients-must-specify-correct-token_endpoint_auth_method

If you're sending the client credentials in the POST body, this mus be set to client_secret_post. This is part of the OpenID Connect Dynamic Client Registration spec which was implemented with beta.5

@Entrio
Copy link
Author

Entrio commented Jul 12, 2018

For those like me, the issue was that I needed to update the property of the client in hydra.
Using standard PUT method, change "token_endpoint_auth_method": "client_secret_post"

I think this issue can now be considered closed

@aeneasr aeneasr changed the title Hydra does not startup after migrating B4 to B6 JSON Web Key Store default keys broken after upgrading to beta.6 Jul 12, 2018
@aeneasr
Copy link
Member

aeneasr commented Jul 12, 2018

The original issue will be fixed by hydra re-generating the keys if the format is broken

aeneasr pushed a commit that referenced this issue Jul 14, 2018
Closes #921

Signed-off-by: arekkas <aeneas@ory.am>
aeneasr pushed a commit that referenced this issue Jul 15, 2018
Closes #921

Signed-off-by: arekkas <aeneas@ory.am>
aeneasr pushed a commit that referenced this issue Jul 15, 2018
Closes #921

Signed-off-by: arekkas <aeneas@ory.am>
aeneasr pushed a commit that referenced this issue Jul 15, 2018
Closes #921

Signed-off-by: arekkas <aeneas@ory.am>
aeneasr pushed a commit that referenced this issue Jul 15, 2018
Closes #921

Signed-off-by: arekkas <aeneas@ory.am>
aeneasr pushed a commit that referenced this issue Jul 15, 2018
Closes #921

Signed-off-by: arekkas <aeneas@ory.am>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants