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

Work with MFA #131

Closed
winstonhenke opened this issue Sep 25, 2019 · 6 comments
Closed

Work with MFA #131

winstonhenke opened this issue Sep 25, 2019 · 6 comments

Comments

@winstonhenke
Copy link

Is this tool supposed to work if my account has 2 factor authentication turned on? I'm getting prompted for my username and password but am receiving a Response status code does not indicate success: 401 (Unauthorized). I've double checked my credentials so I was wondering if MFA might be giving me issues? I've tried giving it a PAT also with no luck

@aasim
Copy link
Member

aasim commented Sep 25, 2019

Can you share the details of the command that you're trying to run? If you're running the dotnet command for example, the first time you might have to run it with the --interactive switch.

@winstonhenke
Copy link
Author

Should also mention I'm trying to run this in WSL using Ubuntu 18.04

I was running nuget restore with nuget version 5.2.0.6090. The username/password prompt I get is right in the command prompt rather than launching a new window of any kind.

I tried dotnet restore --interactive but that never even prompts me and just fails with some more general errors about Unable to load the service index for source.

I was wondering if maybe I installed the plugin on my normal nuget install and maybe the dotnet install has it's own bundled nuget that it uses which may be a bit older? I'm not sure what nuget install is actually used by the dotnet cli though.

@satbai
Copy link
Contributor

satbai commented Sep 26, 2019

If you get the username and password prompts in the console, it likely means that NuGet wasn't able to find the plugin. Did you run one of these scripts to install the cred provider? Please refer to the readme for instructions how the plugin will be discovered. For nuget you need to install the netfx version and for dotnet you will need the netcore version.

@winstonhenke
Copy link
Author

I had followed Manual installation on Linux and Mac to the default location of $HOME/.nuget/plugins.

I hadn't set $NUGET_PLUGIN_PATHS but I have since set that to $HOME/.nuget/plugins. Now when I run nuget restore or dotnet restore it says "A plugin was not found at path '/home/myUsername/.nuget/plugins'."

I verified /home/myUsername/.nuget/plugins/netcore/CredentialProvider.Microsoft/CredentialProvider.Microsoft.dll does exist.

@satbai
Copy link
Contributor

satbai commented Sep 26, 2019

It looks like you've tried with both nuget and dotnet. Dotnet uses the netcore version and nuget uses the netfx version of the plugin, so both need to be installed in $HOME\.nuget\plugins if you want both to work.

You must set the $NUGET_PLUGIN_PATHS environment variable to the CredentialProvider.Microsoft.dll (or CredentialProvider.Microsoft.exe with nuget) instead of the folder. If you have to use both nuget and dotnet, I believe with nuget 5.3 update there are two separate environment variables that you can set, one for the .dll and one for the .exe files: NuGet/Home#8151

Although, if you have the CredentialProvider.Microsoft.dll in $HOME\.nuget\plugins\netcore\CredentialProvider.Microsoft, and CredentialProvider.Microsoft.exe in $HOME\.nuget\plugins\netfx\CredentialProvider.Microsoft, both dotnet and nuget should be able to find the plugin as long as an appropriate version of the tool is used.

@satbai
Copy link
Contributor

satbai commented Feb 5, 2020

Closing the issue due to inactivity. Please refer to the previous comment on how to make nuget/dotnet discover the cred provider plugin. Let me know if you have any questions.

@satbai satbai closed this as completed Feb 5, 2020
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

3 participants