-
Notifications
You must be signed in to change notification settings - Fork 305
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
docker-registry has changed its JWT implementation, no longer supports libtrust key IDs #386
Comments
Note that the breaking change is in v3 but not in v2 of registry. |
I figured out how to work around this. Basically you need to use the JWKS parameter from https://distribution.github.io/distribution/about/configuration/#token It takes a while but bear with me: Note down the keyID because you will need it later. Now how to create the JWKS file:
You will get output like:
use the output to form a json file jwks.json like:
Example setup:
Based on this issue |
@eduardgruy I can't wait to test this! I ended up writing a replacement for docker_auth just so I could start to transition to registry v3.x but I didn't get very far because with the RFC style kid it stops complaining about the key id, but just gives a permission denied message. |
I used the script above to generate a jwks.json file but it does not seem to have helped. There is additional discussion ongoing at distribution/distribution#4487 |
I have no idea how the above worked for anyone, it is not the correct format for the It should contain a top-level {
"keys": [
{
"e": "AQAB",
"kid": "KX3Z:...:C5FZ",
"kty": "RSA",
"n": "xZ...CWQ"
}
]
} EDIT: I see that this is indeed documented above, but for some reason the script doesn't output it in that format? Maybe my haste will help someone else. |
On the apparently likely chance that the distribution maintainers are really going to proceed with releasing distribution/v3 with breaking changes for auth provider support, I have tossed together a quick project to generate a JWKS file from a CA bundle. Any auth providers that have not yet migrated to generating RFC7638 key IDs, and are still using libtrust keyIDs, will need to provide both the CA bundle and the JWKS file. |
It looks like docker-registry made a breaking change on Oct 19th, 2023:
distribution/distribution#4096
As a result the kid field of the JWT token is no longer valid - the code to process the the values produced by docker-libtrust has been removed from docker-registry completely. It is not clear if the kid format just needs to be updated or if there are additional fields needed.
It looks like the last docker-registry commit that will work with the current docker-auth is 1d410148efe6d1b7fd56457507a9dd465b105ec4
The text was updated successfully, but these errors were encountered: