how to authenticate to Azure time series insights query API?
up vote
0
down vote
favorite
I keep getting a AuthenticationFailed
error with a InvalidAuthenticationTokenAudience
inner error when attempting to query the /environments endpoint.
I have already created an app in the Azure Active Directory, given it access in the time series insights management portal and I can already get an Oauth 2.0 Access token from the auth URL.
I have tried giving the token url the 'https://api.timeseries.azure.com/' resource/audience/scope but the API keeps returning the same error message:
{
"error": {
"code": "AuthenticationFailed",
"message": "Server failed to authenticate the request. The token has been obtained from wrong audience or resource.",
"innerError": {
"code": "InvalidAuthenticationTokenAudience",
"message": "The access token has been obtained from wrong audience or resource '00000002-0000-0000-c000-000000000000'. It should
exactly match (including forward slash) with one of the allowed
audiences 'https://api.timeseries.azure.com/'."
}
} }
I'm using Postman with the Oauth 2.0 authentication type, the client credentials Grant Type and send as basic Auth Header option for the token request.
Has anyone tried this with success?
Update 01:
The decoded (using JWT as suggested in comments) payload
portion of one of the tokens shows the that the aud
field is 00000002-0000-0000-c000-000000000000
. Which is definitely wrong.
azure azure-active-directory postman azure-timeseries-insights
add a comment |
up vote
0
down vote
favorite
I keep getting a AuthenticationFailed
error with a InvalidAuthenticationTokenAudience
inner error when attempting to query the /environments endpoint.
I have already created an app in the Azure Active Directory, given it access in the time series insights management portal and I can already get an Oauth 2.0 Access token from the auth URL.
I have tried giving the token url the 'https://api.timeseries.azure.com/' resource/audience/scope but the API keeps returning the same error message:
{
"error": {
"code": "AuthenticationFailed",
"message": "Server failed to authenticate the request. The token has been obtained from wrong audience or resource.",
"innerError": {
"code": "InvalidAuthenticationTokenAudience",
"message": "The access token has been obtained from wrong audience or resource '00000002-0000-0000-c000-000000000000'. It should
exactly match (including forward slash) with one of the allowed
audiences 'https://api.timeseries.azure.com/'."
}
} }
I'm using Postman with the Oauth 2.0 authentication type, the client credentials Grant Type and send as basic Auth Header option for the token request.
Has anyone tried this with success?
Update 01:
The decoded (using JWT as suggested in comments) payload
portion of one of the tokens shows the that the aud
field is 00000002-0000-0000-c000-000000000000
. Which is definitely wrong.
azure azure-active-directory postman azure-timeseries-insights
Could you decode your access token in jwt.io and provide the result in your question?
– Joy Wang
Nov 8 at 3:03
@JoyWang The aud field has the wrong value (see question Update 01), but what else do you want to know from the decoded token?
– pablete
Nov 8 at 12:43
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I keep getting a AuthenticationFailed
error with a InvalidAuthenticationTokenAudience
inner error when attempting to query the /environments endpoint.
I have already created an app in the Azure Active Directory, given it access in the time series insights management portal and I can already get an Oauth 2.0 Access token from the auth URL.
I have tried giving the token url the 'https://api.timeseries.azure.com/' resource/audience/scope but the API keeps returning the same error message:
{
"error": {
"code": "AuthenticationFailed",
"message": "Server failed to authenticate the request. The token has been obtained from wrong audience or resource.",
"innerError": {
"code": "InvalidAuthenticationTokenAudience",
"message": "The access token has been obtained from wrong audience or resource '00000002-0000-0000-c000-000000000000'. It should
exactly match (including forward slash) with one of the allowed
audiences 'https://api.timeseries.azure.com/'."
}
} }
I'm using Postman with the Oauth 2.0 authentication type, the client credentials Grant Type and send as basic Auth Header option for the token request.
Has anyone tried this with success?
Update 01:
The decoded (using JWT as suggested in comments) payload
portion of one of the tokens shows the that the aud
field is 00000002-0000-0000-c000-000000000000
. Which is definitely wrong.
azure azure-active-directory postman azure-timeseries-insights
I keep getting a AuthenticationFailed
error with a InvalidAuthenticationTokenAudience
inner error when attempting to query the /environments endpoint.
I have already created an app in the Azure Active Directory, given it access in the time series insights management portal and I can already get an Oauth 2.0 Access token from the auth URL.
I have tried giving the token url the 'https://api.timeseries.azure.com/' resource/audience/scope but the API keeps returning the same error message:
{
"error": {
"code": "AuthenticationFailed",
"message": "Server failed to authenticate the request. The token has been obtained from wrong audience or resource.",
"innerError": {
"code": "InvalidAuthenticationTokenAudience",
"message": "The access token has been obtained from wrong audience or resource '00000002-0000-0000-c000-000000000000'. It should
exactly match (including forward slash) with one of the allowed
audiences 'https://api.timeseries.azure.com/'."
}
} }
I'm using Postman with the Oauth 2.0 authentication type, the client credentials Grant Type and send as basic Auth Header option for the token request.
Has anyone tried this with success?
Update 01:
The decoded (using JWT as suggested in comments) payload
portion of one of the tokens shows the that the aud
field is 00000002-0000-0000-c000-000000000000
. Which is definitely wrong.
azure azure-active-directory postman azure-timeseries-insights
azure azure-active-directory postman azure-timeseries-insights
edited Nov 8 at 12:41
asked Nov 7 at 19:20
pablete
135311
135311
Could you decode your access token in jwt.io and provide the result in your question?
– Joy Wang
Nov 8 at 3:03
@JoyWang The aud field has the wrong value (see question Update 01), but what else do you want to know from the decoded token?
– pablete
Nov 8 at 12:43
add a comment |
Could you decode your access token in jwt.io and provide the result in your question?
– Joy Wang
Nov 8 at 3:03
@JoyWang The aud field has the wrong value (see question Update 01), but what else do you want to know from the decoded token?
– pablete
Nov 8 at 12:43
Could you decode your access token in jwt.io and provide the result in your question?
– Joy Wang
Nov 8 at 3:03
Could you decode your access token in jwt.io and provide the result in your question?
– Joy Wang
Nov 8 at 3:03
@JoyWang The aud field has the wrong value (see question Update 01), but what else do you want to know from the decoded token?
– pablete
Nov 8 at 12:43
@JoyWang The aud field has the wrong value (see question Update 01), but what else do you want to know from the decoded token?
– pablete
Nov 8 at 12:43
add a comment |
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
Based on the exception, it indicates that the resource is not matching https://api.timeseries.azure.com/
when acquire the access token.
So please make sure that the resource is https://api.timeseries.azure.com/
, for more information please refer to the screenshot.
Get access token
I test Get environments API, it works correctly for me.
GET https://api.timeseries.azure.com/environments?api-version=2016-12-12
Great it works. I was using postman's infrastructure to handle the token request and the subsequent call to the API. I was providing the resource value into the 'Scope' field of the Oauth 2 get new access token form of postman. I I were to use those, where should I include the resources I'm trying to get a token for?
– pablete
Nov 8 at 12:30
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
Based on the exception, it indicates that the resource is not matching https://api.timeseries.azure.com/
when acquire the access token.
So please make sure that the resource is https://api.timeseries.azure.com/
, for more information please refer to the screenshot.
Get access token
I test Get environments API, it works correctly for me.
GET https://api.timeseries.azure.com/environments?api-version=2016-12-12
Great it works. I was using postman's infrastructure to handle the token request and the subsequent call to the API. I was providing the resource value into the 'Scope' field of the Oauth 2 get new access token form of postman. I I were to use those, where should I include the resources I'm trying to get a token for?
– pablete
Nov 8 at 12:30
add a comment |
up vote
3
down vote
accepted
Based on the exception, it indicates that the resource is not matching https://api.timeseries.azure.com/
when acquire the access token.
So please make sure that the resource is https://api.timeseries.azure.com/
, for more information please refer to the screenshot.
Get access token
I test Get environments API, it works correctly for me.
GET https://api.timeseries.azure.com/environments?api-version=2016-12-12
Great it works. I was using postman's infrastructure to handle the token request and the subsequent call to the API. I was providing the resource value into the 'Scope' field of the Oauth 2 get new access token form of postman. I I were to use those, where should I include the resources I'm trying to get a token for?
– pablete
Nov 8 at 12:30
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Based on the exception, it indicates that the resource is not matching https://api.timeseries.azure.com/
when acquire the access token.
So please make sure that the resource is https://api.timeseries.azure.com/
, for more information please refer to the screenshot.
Get access token
I test Get environments API, it works correctly for me.
GET https://api.timeseries.azure.com/environments?api-version=2016-12-12
Based on the exception, it indicates that the resource is not matching https://api.timeseries.azure.com/
when acquire the access token.
So please make sure that the resource is https://api.timeseries.azure.com/
, for more information please refer to the screenshot.
Get access token
I test Get environments API, it works correctly for me.
GET https://api.timeseries.azure.com/environments?api-version=2016-12-12
answered Nov 8 at 6:14
Tom Sun
15.9k2921
15.9k2921
Great it works. I was using postman's infrastructure to handle the token request and the subsequent call to the API. I was providing the resource value into the 'Scope' field of the Oauth 2 get new access token form of postman. I I were to use those, where should I include the resources I'm trying to get a token for?
– pablete
Nov 8 at 12:30
add a comment |
Great it works. I was using postman's infrastructure to handle the token request and the subsequent call to the API. I was providing the resource value into the 'Scope' field of the Oauth 2 get new access token form of postman. I I were to use those, where should I include the resources I'm trying to get a token for?
– pablete
Nov 8 at 12:30
Great it works. I was using postman's infrastructure to handle the token request and the subsequent call to the API. I was providing the resource value into the 'Scope' field of the Oauth 2 get new access token form of postman. I I were to use those, where should I include the resources I'm trying to get a token for?
– pablete
Nov 8 at 12:30
Great it works. I was using postman's infrastructure to handle the token request and the subsequent call to the API. I was providing the resource value into the 'Scope' field of the Oauth 2 get new access token form of postman. I I were to use those, where should I include the resources I'm trying to get a token for?
– pablete
Nov 8 at 12:30
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53196356%2fhow-to-authenticate-to-azure-time-series-insights-query-api%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Could you decode your access token in jwt.io and provide the result in your question?
– Joy Wang
Nov 8 at 3:03
@JoyWang The aud field has the wrong value (see question Update 01), but what else do you want to know from the decoded token?
– pablete
Nov 8 at 12:43