LM-Commons / LmcUser

A generic user registration and authentication module for Laminas. Supports Laminas\Db and Doctrine2. (Formerly ZfcUser)
BSD 3-Clause "New" or "Revised" License
15 stars 16 forks source link

Add option to set the Authentication storage #84

Open visto9259 opened 5 months ago

visto9259 commented 5 months ago

Currently, the authentication service is configured with a LmcUser\Authentication\Storage\Db storage.

Add a module options to define the storage service to use by the Authentication service, with the default being LmcUser\Authentication\Storage\Db.

This will enable the usage of other storage services, including the storage services available from laminas-autentication

tyrsson commented 1 month ago

Not sure if it currently does or not, but you might want to consider setting up a custom session container as well so as to change the namespace to LmcUser_Auth so as to give a visual indicator (in the session data) that the standard container is not being used. It would also further unify sessions for LmcUser. I would also suggest possibly providing explicit factories for all the related session components so as to insure that the default manager is never used.

visto9259 commented 1 month ago

@tyrsson Currently, LmcUser\Authentication\Storage\Db uses Laminas\Authentication\Storage\Session which defaults to the 'Laminas_Auth' session container. Authentication adapters in LmUser then use session containers using the LmcUserNamespace namespace. This container is not used by the Laminas\Authentication\Service.

I would also suggest possibly providing explicit factories for all the related session components so as to insure that the default manager is never used

Can you expand on NEVER using the default manager? Are you talking about the default Laminas session manager? LmcUser does not provide a factory to create the session manager, it is up to the user to provide and start it. Is this what you are talking about?

tyrsson commented 1 month ago

Yes, sorry. That is what I was referring too.

visto9259 commented 1 month ago

Then can you expend on never using the default manager? Why not?