JWT token issue on Azure Management API -
i've been trying use azure service management api in order list hosted services no success.
in first place, able set authentication using powershell microsoft documentation states here: https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx
my first step request access token using oauth2 making post request url:
https://login.windows.net/<my_tenant_id>/oauth2/token
and passing these parameters:
grant_type: client_credentials client_id: <the_client_id_of_the_app_registered_through_powershell> client_secret: <the_password_of_app_registered_through_powershell> resource: https://management.core.windows.net
so, receive valid response , access_token included in response. far good.
then, want make simple call management api; list hosted services (cloud services), make request url:
https://management.core.windows.net/<my_subscription_id>/services/hostedservices
including following headers:
authorization: bearer <the_access_token_received_in_the_previous_step> x-ms-version: 2014-10-01 (i've tested different versions)
but, 401 unauthorized error, following message:
the jwt token not contain expected audience uri 'https://management.core.windows.net/'
i tried native application registered directly in azure portal (with permissions set use service management api) , requesting token using grant_type = authorization_code
. access_token correctly , refresh_token, when try make request above url, same error message.
on side note, able use azure insights api successfully; issue above azure service management api.
anyone knows missing?
i faced same problem today. complete resource url '/' https://management.core.windows.net
see mismatch between url in resource , 1 in error message 'https://management.core.windows.net/'
Comments
Post a Comment