I am getting below error when I attempt a Refresh Token Flow in Azure AD.
AADSTS9002327: Tokens issued for the 'Single-Page Application' client-type may only be redeemed via cross-origin requests
My problem is identical to what is shared below:
https://learn.microsoft.com/en-us/answers/questions/1312290/tokens-for-spa
My HTTP post contains the grant_type
and refresh_token
. I tried to include "origin", "redirection_uri" , "scope" etc but I still get the same error.
Is this problem with my HTTP Post message, with Azure AD app registration, or Azure AD itself?
I created an Azure AD SPA application:
Granted API permissions:
To authorize users, I used below endpoint:
Generated access token by using below parameters via Postman:
And passed Origin as header:
The error "AADSTS9002327: Tokens issued for the 'Single-Page Application' client-type may only be redeemed via cross-origin requests" usually occurs if you are not passing origin as header or passing invalid parameters to refresh the access token.
To refresh the access token, make use of below parameters:
Make sure to pass Origin as header:
I am able to successfully refresh the access token:
The scope parameter is optional. If you are not passing the scope, the original scopes will be used. Or you can request a set of scopes.
If still the issue persists, check the below: