benbaran / adal-angular4-example

Angular 4 ADAL Wrapper Example
28 stars 13 forks source link

Getting an invalid_state error when trying to get the access_token for api #15

Open Bharathjraj opened 6 years ago

Bharathjraj commented 6 years ago

Getting an invalid_state error when trying to get the access_token for api below is how my endpoint look like. When i try to call an API witht he client ID as mentioned for my localhost api its working fine. But when i try to get access token for power bi api its trhowing an invalid_state error in adal. WHen i debugged the adal.js code i can see and access_token has been issued for power bi api, but adal4service is failing to set the token for the given resource. tenant: 'XXXXXX-XXXXXGTTTXXXXXXXX-XXXXXXXXXX', clientId:'XXXXXX-XXXXXXXXXXXXX-XXXXXXXXXX', redirectUri: window.location.origin + '/powerbi', postLogoutRedirectUri: window.location.origin + '/', endpoints: { 'http://localhost:51662/': 'XXXXXX-XXXXXXXXXXXXX-XXXXXXXXXX', 'https://api.powerbi.com': 'https://analysis.windows.net/powerbi/api' },