-
Notifications
You must be signed in to change notification settings - Fork 527
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
Can't sign-in to Generic Docker Registries #2735
Comments
Good to know. It's tough because some of the registries do require |
Alright, I see. I can't see a cleaner solution than the fallback. It's such a shame Gitlab and Portus don't use a 405 Method Not Allowed. |
Hm, this might be more complicated than I first thought. Our auth flow in the generic case is this:
@minjatJ do you know if the providers you gave as examples accept basic auth to get the token from the realm endpoint? |
Hi @bwateratmsft
So in short YES I believe both providers (If not ALL providers) accept basic auth to get the token (As it's what docker clients should use in any case) |
@minjatJ I went ahead with the approach of trying POST first and GET if that fails. Certainly there are still cases where this won't work either--typically if auth happens in any other nonstandard way (which seems to be the standard 🤷♂️). For #869 / #2033 we plan on making a fully-fledged extensibility API for registries. This would allow users to contribute extensions that would be able to authenticate to and use any registry they implement for. |
Awesome, you're a champ @bwateratmsft ! Can't wait to test that |
This change is now released with Docker extension version 1.12.0. |
Hi @bwateratmsft thanks! Just tested 1.12.1 but it looks like fetch is throwing the following "Error: Request with GET/HEAD method cannot have body" so the GET request is not even fired !-_- (See: whatwg/fetch#551). I can create a PR to remove form from What do you think? |
Yeah, go ahead and open a PR. Ultimately, we're going to need #2033 to really handle the multitude of registries well. |
Hello vscode-docker team!
First of all thanks for the great work!
My Setup (From VSCode About)
Issue
I am trying to add 2 Generic docker registries without any success.
Error: Failed with code "404"
After some research and going through my registries logs I might have found out the issue: When asking for a token through the realm Gitlab and Portus only handles GET HTTP requests while vscode-docker is using the method POST (See: https://github.com/microsoft/vscode-docker/blob/main/src/tree/registries/auth/BasicOAuthProvider.ts#L23-L33).
Logs
The working requests were issued by
docker login
command while the others were triggered when listing registries in vscode-docker extension.Gitlab
Portus
What's next?
Do you have any suggestion on how to handle this by any chance? Docker registry specs don't really specify which HTTP method should be used for the
/v2/token
endpoint so I guess there is no right or wrong implementation.I can create a PR to change the call from POST to GET if needed.
Thanks for your time!
Joris
The text was updated successfully, but these errors were encountered: