如何在keycloft和nginx上配置cors



问题是:我们发布了一个带有Vue前端和密钥斗篷授权服务器的应用程序。Key斗篷在docker容器中工作。应用程序位于URL:app.xxxx.xx,授权位于URL:auth.xxxx.xx.Nginx用作代理服务器。一切都启动了,但在授权后,应用程序本身没有加载,并出现错误:

访问'XMLHttpRequesthttps://auth.xxxx.xx/auth/realms/Atlas/protocol/openid-connect/token'(重定向自'http://auth.xxxx.xx/auth/realms/Atlas/protocol/openid-connect/token'(来源'http://app.gxxxx.xx."已被CORS策略阻止:当请求的凭据模式为"include"时,响应中"Access Control Allow Origin"标头的值不得为通配符"*"。由XMLHttpRequest发起的请求的凭据模式由withCredentials属性控制。

密钥斗篷配置

Nginx配置

尝试使用"在";网络起源";在您的客户端配置中?

请参阅Web起源。

最新更新