Okta sessions/me returning 404 when called from Javascript (Redux)

与世无争的帅哥 提交于 2019-12-08 02:14:34

问题


I am trying to get the current session Object from Okta using the sessions/me endpoint called from Javascript (Redux action), but I get a not found response, even when I have an active session.

It's not CORS related, I enabled CORS for my domain.

The best I can tell is a cookie related issue. When I call sessions/me from the browser directly, I see the browser attaching multiple cookies to my request. When I call from javascript, there are no cookies attached to the request.

Is there a way, from Javascript to have access to the cookie needed for sessions/me to succeed?


回答1:


I'm guessing this is a 3rd party cookie issue:

https://blog.zok.pw/web/2015/10/21/3rd-party-cookies-in-practice/

For example, in Safari privacy settings, I am able to repro the 404 on sessions/me if I set "Cookies and website data" to "Allow from current website only". If I set it to "Allow from websites I visit", I no longer get the 404 and /sessions/me works as expected.




回答2:


Which browser are you using? Please see the following page to learn more about CORS and browsers supported: http://developer.okta.com/docs/api/getting_started/enabling_cors.html#browser-support



来源:https://stackoverflow.com/questions/39537490/okta-sessions-me-returning-404-when-called-from-javascript-redux

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!