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

AKV10032: Invalid issuer when we try to fetch key-vault information using DefaultCredential() #26289

Closed
dpmragu opened this issue Jan 12, 2022 · 9 comments
Assignees
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@dpmragu
Copy link

dpmragu commented Jan 12, 2022

Library name and version

Azure.Identity 1.5.0 & Azure.Security.KeyVault.Secrets 4.20

Query/Question

In the Azure portal, a user is added as a Guest in the Tenant where the key-vault resource resides. In addition, the user has associated with default account tenants.

As per the new Identity Framework, the DefaultCredentials() is used to fetch the secret info from Azure Key-Vault. I got the below error message when it executed from the Visual Studio
AKV10032: Invalid issuer. Expected one of https://sts.windows.net/456***********/, https://sts.windows.net/s38**************/, https://sts.windows.net/e4*****************/, found https://sts.windows.net/080**************************/.
Status: 401 (Unauthorized)
ErrorCode: Unauthorized

Even we tried adding tenantId in the default credentials but no luck. Below is the code that we have used in the VisualStudio code.

var options = new DefaultAzureCredentialOptions { VisualStudioTenantId = "s38*****************" }; var client = new SecretClient(vaultUri: new Uri(keyVaultUrl), new DefaultAzureCredential(options));

But able to access the key-vault information using Azure CLI when followed the below steps

  • az login
  • az account list
  • az account set --subscription "my cloud" ( set with tenant where key-vault resides, in my case which start with s38***********)
  • az keyvault secret list --vault-name "my key vault name"

Is there any way to resolve this issue in Visual Studio?

Environment

Visual Studio 2019 16.11.7
Windows 10
.NET Framework 4.6.1

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jan 12, 2022
@dpmragu dpmragu changed the title AKV10032: Invalid issuer.[QUERY] AKV10032: Invalid issuer when we try to fetch key-vault information using DefaultCredential() Jan 12, 2022
@jsquire jsquire added Azure.Identity Client This issue points to a problem in the data-plane of the library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Jan 12, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jan 12, 2022
@jsquire
Copy link
Member

jsquire commented Jan 12, 2022

Thank you for your feedback. Tagging and routing to the team members best able to assist.

@christothes
Copy link
Member

Hi @dpmragu -
Can you confirm that the account you are logging into Visual Studio with is the correct account? Just in case it is helpful, the troubleshooting guide outlines how to confirm.

Also, does authenticate work as expected if you allow the AzureCli to authenticate by logging in with az login?

@christothes christothes added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Jan 12, 2022
@ghost ghost removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Jan 12, 2022
@dpmragu
Copy link
Author

dpmragu commented Jan 13, 2022

Hi @christothes - I followed the troubleshooting guide but got the same error. Here are the few steps that I have done

  1. Tools > Options > logout and login again with the same account
  2. Navigate to the Visual studio profile icon > Remove all the accounts under "All Accounts" and add again.
  3. Deleted the folder from the path %AppData%/Local/.identityService and restarted the VS and logded with the same user

I used the same authentication using Azure CLI.

@ghost ghost added needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team and removed needs-author-feedback Workflow: More information is needed from author to address the issue. labels Jan 13, 2022
@christothes
Copy link
Member

Can you reproduce this with a version of Azure.Security.KeyVault.Secrets v 4.3.0-beta.2 or later?

That version added a new feature that will "discover" the correct tenant Id based on the challenge coming back from the service. Assuming the current account is a member of that tenant, it should attempt again with the correct tenant specified.

@christothes christothes added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Jan 25, 2022
@ghost ghost removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Jan 25, 2022
@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label Feb 2, 2022
@ghost
Copy link

ghost commented Feb 2, 2022

Hi, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@dpmragu
Copy link
Author

dpmragu commented Feb 3, 2022

I tried with Azure.Security.KeyVault.Secrets with version 4.3.0-beta.2 but receiving the same error message AKV10032: Invalid issuer.

Thank you.

@ghost ghost added needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team and removed needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. labels Feb 3, 2022
@dpmragu
Copy link
Author

dpmragu commented Feb 18, 2022

Hi, I tried with Azure.Security.KeyVault.Secrets with version 4.3.0-beta.5 and working fine as expected but not worked when we tried with 4.3.0-beta.2

Thanks.

@christothes christothes added the issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. label Feb 18, 2022
@ghost
Copy link

ghost commented Feb 18, 2022

Hi @dpmragu. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

@ghost ghost removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Feb 18, 2022
@ghost
Copy link

ghost commented Feb 25, 2022

Hi @dpmragu, since you haven’t asked that we “/unresolve” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve” to reopen the issue.

@ghost ghost closed this as completed Feb 25, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

5 participants
@jsquire @christothes @dpmragu @schaabs and others