phpCAS logging logins

25 views
Skip to first unread message

Austin

unread,
May 16, 2019, 9:39:06 PM5/16/19
to cas-...@apereo.org
Hello CAS-Users,

I am using phpCAS 1.3.7 and have the basic functionality working using your simple example, which I include on all of the pages I want to be authenticated.  However, I would also like to log the user logins in my database after the initial authentication.  However, is there any way to tell if the authentication is due to a CAS login or if it's just authenticating against the phpCAS session cookie?

Thanks,

Austin

Alberto Cabello Sánchez

unread,
May 17, 2019, 11:43:17 AM5/17/19
to cas-...@apereo.org
Hi, Austin,

I think CAS logins will show in your logs as having a CAS server referrer.
At least, they do in my mod_auth_cas setup.

I'm not sure, but you can give it a try.

Hope that helps,

--
Alberto Cabello Sánchez
Servicio de Informática
Universidad de Extremadura

Ray Bon

unread,
May 17, 2019, 2:17:14 PM5/17/19
to cas-...@apereo.org
Austin,

You do not have to include the log in code on every page. Have a check for the user logged in on every page (more below) except the login page which will perform the example code. When log in is complete, after forceAuthentication, you can write to the log and add an identifier to the session. You can check for the identifier in the session on each page.

Ray
-- 
Ray Bon
Programmer Analyst
Development Services, University Systems

Austin

unread,
May 17, 2019, 3:43:33 PM5/17/19
to cas-...@apereo.org
A co-worker of mine found this function that seems to work for what I need

phpCAS::setPostAuthenticateCallback('mycallbackfunction');


It only gets called once after the initial login even if I call phpCAS::forceAuthentication() on each page.

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/4dce1e40aeb2688613fcc34bb281040e02dc6b72.camel%40uvic.ca.
Reply all
Reply to author
Forward
0 new messages