Azure-sdk-for-js: VSCode Credential doesn't work

Created on 24 Sep 2020  路  9Comments  路  Source: Azure/azure-sdk-for-js

  • Package Name: @azure/identity
  • Package Version: 1.1.0
  • Operating system: Windows 10
  • [ ] nodejs

    • version:

  • [ ] browser

    • name/version:

  • [x] typescript

    • version: 4.0.2

  • Is the bug related to documentation in

Describe the bug
When trying to use the VisualStudioCodeCredential in the @azure/identity pakcage, you get an error:

azure:core-http:info ServiceClient: using custom request policies
azure:identity:info VisualStudioCodeCredential =>
[Error: Cannot autolaunch D-Bus without X11 $DISPLAY]

Installed keytar as some online posts mentioned, didn't change the output

To Reproduce
Steps to reproduce the behavior:

  1. Create a new VisualStudioCodeCredential
  2. try to use the credential for anything, i.e. getting a token

Expected behavior
The operation should succeed

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
I am an ms internal engineer, feel free to reach out for more context/clarifications

Azure.Identity Client customer-reported needs-team-attention

All 9 comments

+1! Here is my exception:

[9/24/20 8:19:33 PM] Exception: AuthenticationError: invalid_scope(status code 400).
[9/24/20 8:19:33 PM] More details:
[9/24/20 8:19:33 PM] AADSTS70011: The provided request must include a 'scope' input parameter. The provided value for the input parameter 'scope' is not valid. The scope https://management.core.windows.net/ offline_access is not valid. The scope format is invalid. Scope must be in a valid URI form <https://example/scope> or a valid Guid <guid/scope>.
[9/24/20 8:19:33 PM] Trace ID: 59a0d61e-7689-4448-b488-ce853c92dd00
[9/24/20 8:19:33 PM] Correlation ID: 437013bb-9829-44bb-8f73-43f7496c503c
[9/24/20 8:19:33 PM] Timestamp: 2020-09-24 20:19:33Z
[9/24/20 8:19:33 PM] Stack: AuthenticationError: invalid_scope(status code 400).
[9/24/20 8:19:33 PM] More details:
[9/24/20 8:19:33 PM] AADSTS70011: The provided request must include a 'scope' input parameter. The provided value for the input parameter 'scope' is not valid. The scope https://management.core.windows.net/ offline_access is not valid. The scope format is invalid. Scope must be in a valid URI form <https://example/scope> or a valid Guid <guid/scope>.
[9/24/20 8:19:33 PM] Trace ID: 59a0d61e-7689-4448-b488-ce853c92dd00
[9/24/20 8:19:33 PM] Correlation ID: 437013bb-9829-44bb-8f73-43f7496c503c
[9/24/20 8:19:33 PM] Timestamp: 2020-09-24 20:19:33Z
[9/24/20 8:19:33 PM]     at IdentityClient.<anonymous> (/Users/mariehoeger/Documents/repos/Connectors/samples/azurefunctions/memeGenerator/node_modules/@azure/identity/dist/index.js:334:31)
[9/24/20 8:19:33 PM]     at Generator.next (<anonymous>)
[9/24/20 8:19:33 PM]     at fulfilled (/Users/mariehoeger/Documents/repos/Connectors/samples/azurefunctions/memeGenerator/node_modules/@azure/identity/node_modules/tslib/tslib.js:111:62)
[9/24/20 8:19:33 PM]     at process._tickCallback (internal/process/next_tick.js:68:7).

Hello @PIC123 and @mhoeger ! I'm Daniel,

I'll be doing my best to help you.

I'll have an answer for you shortly (as in, up to a couple of hours). Thank you for your patience!

@PIC123 , @mhoeger

I need some help!

For this credential, were you able to authenticate via the Azure Account Extension? https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account

I'll continue investigating tomorrow! thank you for your time.

I'm taking tomorrow off, but I'll come back to this on Monday for sure.

Hey! So for me, if I use the VSCodeCredential, I just get the error I noted above, and it doesn't fall back to any login options. I have the extension set and logged in, but it seems to fail before reaching there even

Hi @sadasant , thank you for the quick response, and enjoy the time off! I also have the extension installed and logged in.

On my end, one thing that I have a valid scope: //.default

My exception changed to this... I tried Azure Logout and then Azure Login again

[9/25/20 6:20:21 AM] System.Private.CoreLib: Exception while executing function: Functions.ShareMeme. System.Private.CoreLib: Result: Failure
[9/25/20 6:20:21 AM] Exception: AuthenticationError: invalid_grant(status code 400).
[9/25/20 6:20:21 AM] More details:
[9/25/20 6:20:21 AM] AADSTS700082: The refresh token has expired due to inactivity. The token was issued on (June) and was inactive for 90.00:00:00.
[9/25/20 6:20:21 AM] Trace ID: 91f46a8f-c408-4f3a-82a2-f12ca3c90e00
[9/25/20 6:20:21 AM] Correlation ID: a5dc4661-c70e-433c-8a65-bd494676d478
[9/25/20 6:20:21 AM] Timestamp: 2020-09-25 06:20:20Z
[9/25/20 6:20:21 AM] Stack: AuthenticationError: invalid_grant(status code 400).
[9/25/20 6:20:21 AM] More details:
[9/25/20 6:20:21 AM] AADSTS700082: The refresh token has expired due to inactivity. The token was issued on (June) and was inactive for 90.00:00:00.
[9/25/20 6:20:21 AM] Trace ID: 91f46a8f-c408-4f3a-82a2-f12ca3c90e00
[9/25/20 6:20:21 AM] Correlation ID: a5dc4661-c70e-433c-8a65-bd494676d478
[9/25/20 6:20:21 AM] Timestamp: 2020-09-25 06:20:20Z
[9/25/20 6:20:21 AM]     at IdentityClient.<anonymous> (/Users/mariehoeger/Documents/repos/Connectors/samples/azurefunctions/memeGenerator/node_modules/@azure/identity/dist/index.js:334:31)
[9/25/20 6:20:21 AM]     at Generator.next (<anonymous>)
[9/25/20 6:20:21 AM]     at fulfilled (/Users/mariehoeger/Documents/repos/Connectors/samples/azurefunctions/memeGenerator/node_modules/@azure/identity/node_modules/tslib/tslib.js:111:62)
[9/25/20 6:20:21 AM]     at process._tickCallback (internal/process/next_tick.js:68:7).

I was able to reproduce this issue. I'm working on it.

After some investigation and through a chat with the team, we've spotted the exact cause of the bug, and we've found a fix! I'll be making a detailed PR soon.

For the record, I was able to confirm the fix in #11598 was also valid for @mhoeger by working together through an internal chat.

Was this page helpful?
0 / 5 - 0 ratings