我有一个asp核心角2 SPA网站,它通过oidc客户端向IdenityServer进行身份验证。IdentitySever与SPA网站CORS问题
我尝试从javascript walthrough example出来的spa认证。
为了模拟水疗中心网站上http://localhost:5000
的identityserver运行在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.
我错过了什么?
是的。我没有完全意识到它。该分部“identityserver”不是identityserver URL的一部分。修复它 –