CORS Oauth Request in JQuery to Azure AD to Access Power BI api -


i working on freshdesk based client apps,

facts , problem:

  1. freshdesk widgets/apps allow jquery/js , html, doesn't give server side support yet developers.
  2. i looking list of power bi reports in widget.
  3. this requires azure ad oauth token, having trouble making cors request.

i how asked freshdesk whitelist domains required microsoft domain's oauth request calls.

i still following error

xmlhttprequest cannot load https://login.microsoftonline.com/common/oauth2/authorize?. response preflight request doesn't pass access control check: no 'access-control-allow-origin' header present on requested resource. origin 'https://xxxx.freshdesk.com' therefore not allowed access.

my code below

jquery.ajax({      type: 'get',      url: authorizeurl,     headers: headers1,     beforesend: function(xhr){xhr.setrequestheader('access-control-allow-origin','https://login.microsoftonline.com');},     success : function(text1)               {console.log(text1);}                      }); 

freshdesk supports oauth in different way.

provide following in oauth_config.yaml

client_id:      "5exxxxxx-xxxx-xxxx-xxxx-xxxxxxxxc8d1" client_secret:  "q8nbxxxxxxxxxxxxxxxx1p1"  authorize_url:  "https://login.domain.com/authorize" token_url:      "https://login.domain.com/token" options:   scope:        "read"   token_type:     "account" 

more information available @ https://developers.freshdesk.com/docs/oauth/


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -