【发布时间】:2017-04-15 18:16:39
【问题描述】:
我有一个 asp core angular 2 SPA 网站,它通过 oidc 客户端向 IdenityServer 进行身份验证。
我尝试从javascript walthrough example out 进行 spa 身份验证。
为了模拟不同的域,spa 站点在http://localhost:5000 上运行,身份服务器在http://localhost:7890 上运行
在 IdentityServer 中,我将 AllowedCorsOrigins 添加到客户端配置中。
AllowedCorsOrigins = new List<string>
{
"http://localhost:5000"
}
但是当我触发重定向时我仍然遇到跨域问题
XMLHttpRequest 无法加载 http://localhost:7890/identity-server/.well-known/openid-configuration。 请求中不存在“Access-Control-Allow-Origin”标头 资源。因此不允许使用原点“http://localhost:5000” 使用权。响应的 HTTP 状态代码为 404。
我错过了什么?
【问题讨论】:
标签: javascript cors identityserver3