dongqiang1894 2012-05-28 01:57
浏览 265
已采纳

Mod Auth CAS两个登录系统

I need to support a Universities CAS Authentication system. This is simple with mod_auth_cas on Apache2 and is working fine.

We now need to add non university users to the system. This in effect means we need to support two login systems. The second login system is our own custom flavor that just auths users via POST to PHP.

It seems this is an impossible environment to setup. Any tips?

  • 写回答

1条回答 默认 最新

  • dongshui2254 2012-05-30 05:22
    关注

    The solution turned out to be phpCAS.

    Using regular mod_auth_cas you are jailing entire locations behind CAS with no way to optionally disable it.

    Using phpCAS you can perform the authentication OPTIONALLY in a php file.

    All my php files are communicated to via ajax POST GET requests, so the login mechanism needed to prevent access to these files if not logged in and cause a redirect. Using the php $_SESSION variable we can store whether login was made and successful. On every access we can check the $_SESSION variable and do a quick exit after pushing a JSON message back to the javascript client informing them of the failure and to redirect.

    When the user attempts to login they can choose the CAS route. Using phpCAS it will properly redirect them to the CAS server and back to my App when finished. If they choose the in house login database then they fill out a simple form like any homebrew login system. In both cases the $_SESSION stores the success and that success is checked and verified upon access to the critical PHP files.

    Since it is verified and checked, is CAS expires we will catch it here. The in house login system expires inline with the PHP Session.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 matlab yalmip kkt 双层优化问题
  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题