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

The access token is from the wrong issuer #37

Closed
re4s0n4 opened this issue Apr 27, 2021 · 4 comments · Fixed by #57
Closed

The access token is from the wrong issuer #37

re4s0n4 opened this issue Apr 27, 2021 · 4 comments · Fixed by #57
Labels
bug Something isn't working

Comments

@re4s0n4
Copy link

re4s0n4 commented Apr 27, 2021

I encounter an issue while using Powershell 5.1 and 7.2 authenticated using my Subscription administrator account (Connect-AzAccount -UseDeviceAuthentication):

Get-AzResource : The access token is from the wrong issuer
'https://sts.windows.net/xxxxxxxx-xxxxxx-xxxxxxx-xxxxxxx/'. It must match the tenant
'https://sts.windows.net/xxxxxxxx-xxxxxx-xxxxxxx-xxxxxxx/' associated with this subscription. Please use the
authority (URL) 'https://login.windows.net/xxxxxxxx-xxxxxx-xxxxxxx-xxxxxxx' to get the token. Note, if the
subscription is transferred to another tenant there is no impact to the services, but information about new tenant
could take time to propagate (up to an hour). If you just transferred your subscription and see this error message,
please try back later.
At C:\Users\rfabiano_wa\AzViz\AzViz\src\private\ConvertFrom-Network.ps1:90 char:48

  • ... toCateg = (Get-AzResource -ResourceId $to.ResourceId).Resour ...
  •                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : CloseError: (:) [Get-AzResource], CloudException
    • FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet

I think this may be because I am a Subscription Administrator but not a tenant administrator.

@PrateekKumarSingh
Copy link
Owner

PrateekKumarSingh commented Apr 27, 2021

@re4s0n4 yes, this piece of code basically looks for network associations and in this case it seems like a network components is associated with another network resource in a different subscription. If that is the case this is the ideal behavior if you don't have permissions on other subscription.

That being said, I'll try to add better error handling around it and meanwhile trying to replicate the issue at my end.

Thanks for creating an issue!

@re4s0n4
Copy link
Author

re4s0n4 commented Apr 28, 2021

Same user has access to all associated resources. I'm guessing it may have to do with peering networks to a subscription for which I am also a full admin. Maybe some error handling would clarify which resource it's being blocked on and maybe make it not breaking error.

@PrateekKumarSingh PrateekKumarSingh added the bug Something isn't working label May 14, 2021
@PrateekKumarSingh PrateekKumarSingh added this to the Release AzViz v1.2 milestone May 14, 2021
@signalwarrant
Copy link

I get this same error only when I try to use AzViz in Azure Government. In my situation URL #1 is different than URL #2.

image

@franklixuefei
Copy link

I get this same error only when I try to use AzViz in Azure Government. In my situation URL #1 is different than URL #2.

image

Hi! Have you resolved this issue? I encountered the same issue and the URL #1 is the Azure gov tenant ID. In my case, its fairfax (cab8a31a....)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants