81
Views
1
Comments
How to run an action after SSO Login
Question

I Use SAML IdP on a reactive web app and I want to write logs for every user that performs login to the app.
Since I don't use the default DoLogin action because I redirect to an external login page, 
I need to know where can I put the action that writes the logs I need for every login. 

Maybe someone here encountered this issue before?

P.S I know I can access the SAML logs directly In the Service Center, but this is not what I'm looking for

2021-11-12 04-59-31
Manikandan Sambasivam

To log user logins in a reactive web app using SAML IdP without using the default DoLogin action in OutSystems, you can create a custom logging mechanism that is triggered whenever a user successfully logs in via SAML. 

Steps to Implement Custom Login Logging with SAML IdP

  1. Create a Custom Server Action for Logging:

    • Create a new server action that will handle the logging. This action should take relevant parameters like UserId, UserName, LoginTime, etc., and insert them into a logging entity.
  2. Trigger Logging After SAML Authentication:

    • After the user is successfully authenticated via SAML, you need to call the LogUserLogin action. This is typically done after the SAML response is processed and the user is authenticated.
  3. Customize the SAML Authentication Flow:

    • If you are using an external SAML login page, you need to identify where the SAML response is processed in your application. This is usually handled in a specific callback URL or endpoint that processes the SAML response.
  4. Add Logging in the SAML Response Handling:

    • In the logic where you handle the SAML response and authenticate the user, add a call to the LogUserLogin action. This can be done in the server action that processes the SAML response.
  5. Ensure SAML Response Handling:

    • Make sure the SAML response handling correctly extracts the user information and triggers the logging action. This is crucial to ensure that every successful login is logged.
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.