I resolved it by adding a logic flow in powerapps.
I created a HTTP logic flow and sending the client credentials there and processing the Access Token api and in the response i am getting the access token. so now i am not getting any CORS issue.
CORS issue while getting token with Oauth 2.0 Client credential flow using React embedded PowerApps PCF Component
I am able to get the Bearer token from the postman using this api
https://login.microsoftonline.com/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/oauth2/v2.0/token
client_id : <client-id/app-id>,
resource : <resource>,
client_secret:<client-secret>,
grant_type : "client_credentials"
Content-Type : "application/x-www-form-urlencoded"
and I am trying to use this flow in Powerapps PCF Component.
This PCF component is embedded into a canvas app.
I can use grant_type=authorization_code but I have to add a redirect_uri and I don't want to add any redirection to my code.
Is there any way, I can get the access token and don't get any cors issues?
I want to acquire a token without a login popup if possible.
Error on local environment
Error in canvas app when i embed PCF solution on canvas app
1 answer
Sort by: Most helpful
-
Dhruvil Dave 6 Reputation points
2022-01-27T07:09:42.637+00:00