Open Launcelot555 opened 5 years ago
Looks like this regression was introduced OneGet/NuGetProvider#56 wherein provided credentials appear to be disregarded.
Could you share what your -verbose -debug output is?
What you see is the verbose output.
You can repro this by doing the following:
$PAT = Read-Host -Prompt PAT -AsSecureString
$AzDoOrg = Read-Host -Prompt 'Azure DevOps Organization'
$FeedName = Read-Host -Prompt 'Azure DevOps Artifact Feed Name'
$Credentials = [pscredential]::new('azdo',$PAT)
$FeedUri = 'https://pkgs.dev.azure.com/{0}/_packaging/{1}/nuget/v2/' -f $AzDoOrg, $FeedName
Register-PSRepository -Name $FeedName -SourceLocation $FeedUri -Credential $Credentials -InstallationPolicy Trusted -PackageManagementProvider Nuget -PublishLocation $FeedUri -Verbose -Debug
Works fine in PackageManagement 1.4, but in 1.4.1 it prompts like this:
[Minimal] [CredentialProvider]DeviceFlow: https://pkgs.dev.azure.com/*********/_packaging/*****/nuget/v2/
[Minimal] [CredentialProvider]To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code *********** to authenticate.
Thanks for all the feedback, and patience--we've released updates to both PackageManagement and PowerShellGet yesterday to fix this and I wanted to see if that had resolved the issues you are facing?
CC: @alerickson
@SydneyhSmith and @alerickson I have confirmed that the problem persists with PM 1.4.2 and PSGet 2.1.5. The same repro code above still produces the same result.
Thanks for letting us know! I’ll look into this today. This integration’s been a bit hairy so thanks for bearing with us
@Launcelot555 @markekraus I just published PowerShellGet and PackageManagement to our int gallery (www.poshtestgallery.com/api/v2). Please feel free to test these out and see if behavior is working appropriately. The credential provider should only be prompted if the -credential parameter is not passed in
To get these modules from the int gallery run:
Register-PSRepository -Name PoshTestGallery -SourceLocation https://www.poshtestgallery.com/api/v2
Install-Module PowerShellGet, PackageManagement -Repository PoshTestGallery -Force
@alerickson @SydneyhSmith the problem appears to be resolved in PM 1.4.3 and PSGet 2.2
Environment Overview
Hosted VS2017 Azure DevOps Agent
Issue Overview
When providing a PAT and PSCredential object to Register-PSRepository in Azure DevOps using PackageManagement 1.4.1, two-factor authentication is required. This is to register an Azure DevOps Artifact Repository.
Expected Behavior
In previous versions of PackageManagement, providing a PAT did not require multi-factor authentication.
Actual Behavior