-
Notifications
You must be signed in to change notification settings - Fork 67
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
auth: authentication.getSession
doesn't respect scopes argument
#1596
Comments
I found a way to work around this if someone needs it while this is being worked on. Looking at the fix, I found you can use the built in getSession method, and along with the scopes you need, add in VSCODE_TENANT:{tenantId} For example: The access token in the session you get back will then work with the associated API (Azure, etc) for the tenant you provided. |
The same issue surfaces when using AzureSubscription.credential.getToken(scopes) method. Code:
|
Try this
|
@nturinski , I do not see such a method in AzureSubscription class. Where do I get that method from? |
Sorry, you're correct. It is not something that's implemented on the If you install the |
How did you come across that scope? I tried the same thing and also am ending up with null. However, |
Oh, my memory really isn't that good, it emerged from some early days of DfMon. Anyway, apparently @mikeburgh 's workaround worked for me, so there 's no need for further workarounds. |
The implementation returns the same session regardless of what scopes are passed to
getSession()
.vscode-azuretools/auth/src/VSCodeAzureSubscriptionProvider.ts
Line 262 in 51c5c77
The text was updated successfully, but these errors were encountered: