Event After SAML Auth

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
alliance8791
User
Posts: 49

Event After SAML Auth

Post by alliance8791 »

Hi, I've been using the login functionality with SAML with phpmaker 2023, specifically using simpleSAMLphp and it's working perfectly. In particular, my simpleSAMLphp interfaces with the Italian SPID national authentication system.
I have a problem, if the user who is successfully authenticated by SAML doesn't exist in my table, I can't access the protected pages. Instead, I would like that whether the user exists or doesn't exist, the user could access protected pages.
My question is: Is there an event that can be fired right after SAML authentication and before verifying that the user exists in my table? Could I use this event to make an insert in the users table with the data I pass from the SAML authentication?
Thanks in advance for the help.
Ciao


arbei
User
Posts: 9286

Post by arbei »

You may try the User_CustomValidate server event.


alliance8791
User
Posts: 49

Post by alliance8791 »

Tnx, do you think i can do an sql query to add the user to the user table before the validation ? If so, can you write an example ?
Do you have another idea to bypass this problem ?
Ciao


arbei
User
Posts: 9286

Post by arbei »

Of course you can, you can execute by ExecuteStatement(), but if you only want to assign user level to the user so he/she can access protected tables, you can do that by the server event without the need to add users dynamically. (If you can add user, you already know the user level.)


alliance8791
User
Posts: 49

Post by alliance8791 »

It worked! Thanks a lot.
ciao.


Post Reply