I think I'm asking the same thing that the question here is asking.
Here is what I am doing:
1.) A user that is not in my database logs in to my application for the first time.
2.) The user is authenticated via LDAP
3.) I listen for an AuthenticationSuccessEvent
. When detected I add the user to the my database if they do not exist, or update their info with the LDAP info if they do exist.
My problem is that if I add a user to my database for the first time they don't have an id
until after they are added. I want to update the principal
so id
is accessible from the principal
object.
I have tried the approach described here but it didn't work.