Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the IP of the request in the event listener #112

Open
ntbutler-nbcs opened this issue Jan 3, 2025 · 0 comments
Open

How to get the IP of the request in the event listener #112

ntbutler-nbcs opened this issue Jan 3, 2025 · 0 comments

Comments

@ntbutler-nbcs
Copy link

Hi all.

I want to be able to log the user's IP against the user when they are authenticated, but can't figure out how to do this. I'm working in the event listener that handles the \Slides\Saml2\Events\SignedIn::class event, but that doesn't seem to have access to the request so I can't get the IP that way.

I did try adding the IP to the session before my router/controller redirects the user to the IdP to auth, but it looks like the session is overwritten with a new session by the time the SignedIn event is triggered, so that value no longer exists in the session.

Any ideas would be welcome.
Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant