A co-worker of mine found this function that seems to work for what I need

phpCAS::setPostAuthenticateCallback('mycallbackfunction');

https://apereo.github.io/phpCAS/api/group__publicAuth.html#gaef46bf2c415a72f1e81a1bf3a75b1324
https://hotexamples.com/examples/-/phpCAS/setPostAuthenticateCallback/php-phpcas-setpostauthenticatecallback-method-examples.html

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

On Fri, May 17, 2019 at 8:17 AM Ray Bon <[email protected]> wrote:

> 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
>
> On Thu, 2019-05-16 at 15:38 -1000, Austin wrote:
>
> Hello CAS-Users,
>
> I am using phpCAS 1.3.7 and have the basic functionality working using
> your simple example
> <https://github.com/apereo/phpCAS/blob/master/docs/examples/example_simple.php>,
> 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
>
> --
>
> Ray Bon
> Programmer Analyst
> Development Services, University Systems
> 2507218831 | CLE 019 | [email protected]
>
> --
> - 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/a/apereo.org/d/msgid/cas-user/4dce1e40aeb2688613fcc34bb281040e02dc6b72.camel%40uvic.ca
> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/4dce1e40aeb2688613fcc34bb281040e02dc6b72.camel%40uvic.ca?utm_medium=email&utm_source=footer>
> .
>

-- 
- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAKL84%3DmkXebOqDS0JtkPmL%3DQ_cxnuD-u7nQf19y6F%2BccXCVXzQ%40mail.gmail.com.

Reply via email to