Skip to content

Update user #81

Open
Open

Description

@katerina-n

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

Activity

  1. frostieDE commented on Apr 5, 2020

    @frostieDE

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions