kag*_*ag0 8 javascript authentication redirect cors oauth-2.0
我有一个受OAuth 2授权代码流保护的后端应用程序.前端(浏览器中的javascript)命中后端的授权端点,后端将浏览器重定向到授权代码服务器,用户进行身份验证,然后授权服务器使用授权代码将浏览器重定向回后端后端赎回令牌以访问某些服务.
问题是这些重定向都是连续发生的,浏览器中的CORS阻止了交换.服务器需要做什么才能使这个流程工作?
browser -> POST app.com/auth
307 auth.com/auth?redirect=app.com/auth <-
browser -> POST auth.com/auth?redirect=app.com/auth (with authorization header)
307 app.com/auth?authcode=fubar <-
browser -> POST app.com/auth?authcode=fubar
Run Code Online (Sandbox Code Playgroud)
大概是怎么回事.
编辑:浏览器说
XMLHttpRequest无法加载http://app.com/autho.该请求被重定向到" http://autho.com/auth?response_type=code&redirect_uri=http://app.com/autho&state=639bfbe7-fd20-4c04-8feb-c9f60f4d55a9&client_id=0xdeadbeef ",不允许跨域来源需要预检的请求.
EDIT2:所以重定向工作正常没有Authorization标题.猜猜现在数据正在进行中.
| 归档时间: |
|
| 查看次数: |
7561 次 |
| 最近记录: |