Open Arkusm opened 2 weeks ago
I tried to do so (https://github.com/collective/pas.plugins.oidc/pull/41) trying to log in the user in portal_membership tool, but I failed because the request is not yet authenticated.
You could trigger an event in plugins.py.
from Products.PluggableAuthService.events import PrincipalCreated
from zope.event import notify
...
notify(PrincipalCreated(user)) # line 218 befor break
This works. You can then create a subscriber this way
<!-- New Member created -->
<subscriber
for="Products.PluggableAuthService.interfaces.authservice.IPropertiedUser
Products.PluggableAuthService.interfaces.events.IPrincipalCreatedEvent"
handler=".updater.new_user"
/>
But I don't know whether this is desired or should be done.
I think it is desired. It should be so, because there is a specific event for that.
During the login process, an attempt is made to create a new user (plone member). I think that IUserAdderPlugin is used for this. Unfortunately no plone event is triggered in this context or I don't know which one. Even if the creation of the user was successful. Normally such an event is always triggered when a new user is created, like here.
My system uses a UsersAsContent implementation and I need such an event to create a new user object.
Can someone tell me if a corresponding event is triggered?