I am trying to setup a Windows build with access to the GitHub Package Registry, specifically for NuGet packages. When you attempt to authorize the registry as documented [1] and pasted in here, an Access denied.
error occurs…
nuget sources Add -Name "GPR" \
-Source "https://nuget.pkg.github.com/OWNER/index.json" \
-UserName USERNAME -Password TOKEN
Running this with the -Verbosity detailed
flag yields the error:
Access is denied.
System.Security.Cryptography.CryptographicException: Access is denied.
at System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope scope)
at NuGet.Configuration.EncryptionUtility.EncryptString(String value)
at NuGet.Configuration.PackageSourceCredential.FromUserInput(String source, String username, String password, Boolean storePasswordInClearText, String validAuthenticationTypesText)
at NuGet.CommandLine.SourcesCommand.AddNewSource()
at NuGet.CommandLine.Command.ExecuteCommandAsync()
at NuGet.CommandLine.Command.Execute()
at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
I was able to work around this by adding the -StorePasswordInClearText
flag, which avoids this codepath, but am confused as to why I need to do that in the first place.
Is there some configuration available to me that allows the use of these cryptographic functions in the CircleCI environment?