是否默认启用 CAS(中央身份验证服务)CORS?
Is CAS (Central Authentication Service) CORS enabled by default?
文档清楚地表明 CAS 提供 first-class 支持以启用 HTTP 访问控制 (CORS)。 但是,它是默认启用还是需要进行设置?
我正在开发一个 Web 应用程序,其中客户端 Angular 代码试图访问另一个域上的服务器 api。服务器本身启用了 CORS。通信在没有任何安全措施的情况下工作正常。一旦我将 CAS single sign-on 引入混音,我就得到了以下错误:
Failed to load
https://myCasServer.com/?service=http%3A%2F%2Flocalhost%3A8080%2Fauthenticate:
Redirect from
'https://myCasServer.com/?service=http%3A%2F%2Flocalhost%3A8080%2Fauthenticate'
to
'http://myCasServer.com/login?service=http%3A%2F%2Flocalhost%3A8080%2Fauthenticate'
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is
therefore not allowed access.
响应中没有 Access-Control-Allow-Origin headers。
我正在使用 Cas 2.0
CAS 默认不启用 CORS。您需要添加 https://apereo.github.io/cas/5.2.x/installation/Configuration-Properties.html#http-web-requests 中列出的配置设置。例如
cas.httpWebRequest.cors.enabled: true
cas.httpWebRequest.cors.allowCredentials=false
cas.httpWebRequest.cors.allowOrigins[0]=*
cas.httpWebRequest.cors.allowMethods[0]=*
cas.httpWebRequest.cors.allowHeaders[0]=*
文档清楚地表明 CAS 提供 first-class 支持以启用 HTTP 访问控制 (CORS)。 但是,它是默认启用还是需要进行设置? 我正在开发一个 Web 应用程序,其中客户端 Angular 代码试图访问另一个域上的服务器 api。服务器本身启用了 CORS。通信在没有任何安全措施的情况下工作正常。一旦我将 CAS single sign-on 引入混音,我就得到了以下错误:
Failed to load https://myCasServer.com/?service=http%3A%2F%2Flocalhost%3A8080%2Fauthenticate: Redirect from 'https://myCasServer.com/?service=http%3A%2F%2Flocalhost%3A8080%2Fauthenticate' to 'http://myCasServer.com/login?service=http%3A%2F%2Flocalhost%3A8080%2Fauthenticate' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
响应中没有 Access-Control-Allow-Origin headers。 我正在使用 Cas 2.0
CAS 默认不启用 CORS。您需要添加 https://apereo.github.io/cas/5.2.x/installation/Configuration-Properties.html#http-web-requests 中列出的配置设置。例如
cas.httpWebRequest.cors.enabled: true
cas.httpWebRequest.cors.allowCredentials=false
cas.httpWebRequest.cors.allowOrigins[0]=*
cas.httpWebRequest.cors.allowMethods[0]=*
cas.httpWebRequest.cors.allowHeaders[0]=*