【问题标题】:CAS authentication in localhost with an application running locally本地主机中的 CAS 身份验证,应用程序在本地运行
【发布时间】:2013-06-14 18:05:16
【问题描述】:

我在本地设置了 CAS。我有一个也在本地运行的 grails 应用程序。我的 CAS 身份验证有效。我的 CAS 正在这个位置运行

http://localhost:8081/cas/login?service=http%3A%2F%2Flocalhost%3A8081%2Fj_spring_cas_security_check

我的 grails 应用程序在 http://localhost:8080/CASTest/test/ 运行

所以当我转到我的 grails 应用程序时,我会被重定向到 CAS 进行登录,但是在登录后,我在我的 CAS 中不断收到evaluationException on hostUrl。我认为错误是因为 CAS 中服务字段中的 localhost,如果我将其更改为 test1.localhost 它可以工作,它会在身份验证后将我重定向到 test1.localhost。有什么想法可以将其重定向回本地运行的应用程序吗?

【问题讨论】:

    标签: authentication grails redirect cas


    【解决方案1】:

    尝试配置您的操作系统的hosts file 以接受为您的应用程序选择的域作为 localhost 的别名,然后在开发环境中的 CAS 配置中使用它。

    查看Wikipedia entry for the hosts file 以获取系统中的适当位置(如果您使用的是 Linux,则为/etc/hosts),然后添加如下行:

    127.0.0.1    test1.localhost
    

    之后,您可以在开发环境的 CAS 配置中使用它——serviceUrl 配置应该指向类似 http://test1.localhost/CASTest/j_spring_cas_security_check 的东西。

    希望对你有帮助!

    【讨论】:

      猜你喜欢
      • 2021-09-11
      • 2015-07-26
      • 1970-01-01
      • 2014-10-13
      • 2021-07-07
      • 1970-01-01
      • 2019-10-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多