i'm integrating onedrive , onedrive enterprise api current project. i'm stucked @ oauth process, generating refresh token , access token later use.
these calls made via ajax request, , apparently microsoft oauth endpoints not support cors (missing access-control-allow-origin header in response).
request headers ajax:
post /common/oauth2/token http/1.1 host: login.microsoftonline.com connection: keep-alive content-length: 987 pragma: no-cache cache-control: no-cache accept: */* origin: http://localhost user-agent: mozilla/5.0 (macintosh; intel mac os x 10_11_6) applewebkit/537.36 (khtml, gecko) chrome/51.0.2704.103 safari/537.36 content-type: application/x-www-form-urlencoded; charset=utf-8 referer: http://localhost accept-encoding: gzip, deflate, br accept-language: en-us,en;q=0.8
response headers:
http/1.1 200 ok cache-control: no-cache, no-store pragma: no-cache content-type: application/json; charset=utf-8 expires: -1 server: microsoft-iis/8.5 strict-transport-security: max-age=31536000; includesubdomains x-content-type-options: nosniff x-ms-request-id: 4af29899-6eec-485b-81f4-eb654e4ce8f0 client-request-id: e307d3b2-dcdd-4e6f-b892-3f0ab9b6d8e7 x-ms-responsehealth: targetid=estsfe_in_166;action=none;category=none;health=0;load=25; p3p: cp="dsp cur otpi ind otri onl fin" set-cookie: esctx=aaabaaaa0tweun3yuuq5vucvmnaqicx4mvi1_yi1ufs9w-9yaaqpxcgxvr8oieo7fqzcdm0aypgvgmjfun03xw6nudd_d5mkllyoacmzmimrn53jr-rxnb2rhkeckzwc4hrtwqxbr7wjf9jm75f4zpfoohv_hcns_42xq8byfsqqtqsd7xvig6tbzxrjam8kyb1bqrgniaa; domain=.login.microsoftonline.com; path=/; secure; httponly set-cookie: x-ms-gateway-slice=productionb; path=/; secure; httponly set-cookie: stsservicecookie=ests; path=/; secure; httponly x-powered-by: asp.net date: thu, 21 jul 2016 18:29:16 gmt content-length: 3024
console error:
xmlhttprequest cannot load https://login.microsoftonline.com/common/oauth2/token. no 'access-control-allow-origin' header present on requested resource.
has come same issue?
do need setup on microsoft azure console?
Comments
Post a Comment