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

Update user #81

Open
katerina-n opened this issue Sep 9, 2019 · 1 comment
Open

Update user #81

katerina-n opened this issue Sep 9, 2019 · 1 comment

Comments

@katerina-n
Copy link

Could you please assist me one more time? Is there any way to update a logged in user info if his name/phone/title were changed? I haven't found any other option except of override AuthenticationSuccessHandlerInterface and put it there. But I suppose that is not the best solution

@frostieDE
Copy link

frostieDE commented Apr 5, 2020

One way is to provide a custom SamlSpTokenFactory which then dispatches a custom AuthenticationEvent. See my implementation (SamlSpTokenFactory.php, AuthenticationEvent.php).

Do not forget to configure the custom Factory inside your security.yaml:

...
       secured:
            pattern: ^/
            light_saml_sp:
                provider: database
                user_creator: App\Security\User\UserCreator
                login_path: /saml/login
                check_path: /saml/login_check
                token_factory: App\Security\SamlSpTokenFactory

I don't know if it is the best way to do this, but it works for us 😄

I am not sure why we are not using Symfony's security events. This should be a better way to do this :-) You may fetch the current SamlSpResponseToken which has a method getResponse() which should return the SAML Response.

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

2 participants