-
Notifications
You must be signed in to change notification settings - Fork 444
Azure Active Directory Authentication Samples
GET https://management.azure.com/subscriptions
?api-version=2017-08-01
Authorization: {{$aadToken}}
GET https://management.azure.com/subscriptions
?api-version=2017-08-01
Authorization: {{$aadToken 00000000-0000-0000-0000-000000000000}}
GET https://management.azure.com/subscriptions
?api-version=2017-08-01
Authorization: {{$aadToken contoso.com}}
GET https://management.azure.com/subscriptions
?api-version=2017-08-01
Authorization: {{$aadToken new contoso.com}}
REST Client uses an in-memory token cache that clears when Visual Studio Code is restarted. You can clear the token cache manually by using
F1 > Rest Client: Clear Azure AD Token Cache
._
new
can be used with any other options, as long as it's specified first. Order is important for all options._
GET https://fabrikam.com/api/foo
Authorization: {{$aadToken aud:000000000000-0000-0000-0000-00000000}}
Audience (
aud
) must be an allowed value by the target API you are calling. Usually, this is a URL ending in a slash (/), but may also be an app/client id or other value. Contact the app owner to determine valid options._
Audience (
aud
) can be used with any other options, as long as it's specified last. Order is important for all options._
GET https://management.microsoftazure.de/subscriptions
?api-version=2017-08-01
Authorization: {{$aadToken}}
GET https://management.usgovcloudapi.net/subscriptions
?api-version=2017-08-01
Authorization: {{$aadToken us}}
Azure China does not work like the other clouds. Use of Azure China is allowed, but may fail._
Use of Azure AD is not limited to Azure APIs. Inclusion here is for demonstration purposes only._
Thanks @flanakin for implementing this feature and providing following samples.