Huachao / vscode-restclient

REST Client Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=humao.rest-client
MIT License
5.32k stars 445 forks source link

How to get a token from another tenant than the user that logs in #1308

Open BartNetJS opened 1 month ago

BartNetJS commented 1 month ago

I'm trying the following:

GET https://[a rest url] Authorization: Bearer {{$aadToken tenantId={{tenant-id}} clientId={{client-id}} authority=https://login.microsoftonline.com/{{tenant-id}}}}

The user i login with is from another tenant, but has access to the tenant defined as tenant-id

What happens is that the interactive browser is redirecting to the tenant from the users email address, and not the tenant-id The url is like this: https://login.microsoftonline.com/common/reprocess?....

But should be: https://login.microsoftonline.com/tenant-id where tenant-id is the {{tenant-id}}

How can I achieve this?