question

Dev-8176 avatar image
0 Votes"
Dev-8176 asked saldana-msft edited

CORS issue while accesing and getting token for the application on application level and not logged in user?

I want to access organization user on the application level for users which are not logged in.
Below is the API I am hitting for same

https://login.microsoftonline.com/xxxxxxxxxxxxxxxxxxxxxxxx/oauth2/v2.0/token

I am getting the CORS error although i am allowing CORS
in the header.
Please find sample to access the token.

const requestHeaders: HeadersInit = new Headers();
requestHeaders.set('Content-Type', 'application/x-www-form-urlencoded');
requestHeaders.set('client_id','xxxxxxxxxxxxxxxxxxxxxxxx');
requestHeaders.set('scope',"https://graph.microsoft.com/.default");
requestHeaders.set('Access-Control-Allow-Origin',"*");
requestHeaders.set('client_secret','xxxxxxxxxxxxxxxxxxx');
requestHeaders.set('grant_type',"client_credentials");

Thanks
Sanjeev

microsoft-graph-sdkmicrosoft-graph-identity
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Danstan-MSFT avatar image
0 Votes"
Danstan-MSFT answered

I see this question same as this one you asked and I answered. Please check the linked question.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.