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

nerdctl login fails when 2fa is enabled (registry.gitlab.com) #3378

Open
hrkrx opened this issue Aug 29, 2024 · 3 comments
Open

nerdctl login fails when 2fa is enabled (registry.gitlab.com) #3378

hrkrx opened this issue Aug 29, 2024 · 3 comments
Labels
area/login authentification/ login question Further information is requested

Comments

@hrkrx
Copy link

hrkrx commented Aug 29, 2024

Description

When enabling 2fa in gitlab the login to the registry is not working.

Steps to reproduce the issue

  1. enable gitlab 2fa
  2. run "nerdctl login registry.gitlab.com -u user"
  3. input password
  4. Error:
ERRO[0012] failed to call tryLoginWithRegHost            error="failed to call rh.Authorizer.Authorize: failed to fetch oauth token: unexpected status from GET request to https://gitlab.com/jwt/auth?offline_token=true&service=container_registry: 401 Unauthorized" i=0
FATA[0012] failed to call rh.Authorizer.Authorize: failed to fetch oauth token: unexpected status from GET request to https://gitlab.com/jwt/auth?offline_token=true&service=container_registry: 401 Unauthorized

Describe the results you received and expected

I expected the login to function normally even with 2fa

What version of nerdctl are you using?

0.23.0

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

Rancher Desktop for Windows

Host information

Windows 10
(WinBuild.160101.0800)

@hrkrx hrkrx added the kind/unconfirmed-bug-claim Unconfirmed bug claim label Aug 29, 2024
@apostasie
Copy link
Contributor

Thanks @hrkrx
I am not a gitlab user.
Would you have a reproducer for this? (eg: a few lines to setup gitlab with 2fa locally)

Otherwise, I will look into gitlab of course - but might take some time.

@AkihiroSuda AkihiroSuda changed the title nerdctl login fails when 2fa is enabled nerdctl login fails when 2fa is enabled (registry.gitlab.com) Aug 30, 2024
@AkihiroSuda AkihiroSuda added the area/login authentification/ login label Aug 30, 2024
@apostasie
Copy link
Contributor

@hrkrx does docker support 2FA?

@apostasie
Copy link
Contributor

apostasie commented Sep 1, 2024

Actually, since you enabled 2FA, you need to use a personal access token or a deploy token to login against your gitlab registry with a cli.

This is true for both docker and nerdctl.

Documentation here:

https://docs.gitlab.com/ee/user/packages/container_registry/troubleshoot_container_registry.html

@AkihiroSuda can we tag this as question and close it?

@AkihiroSuda AkihiroSuda added question Further information is requested and removed kind/unconfirmed-bug-claim Unconfirmed bug claim labels Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/login authentification/ login question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants