Change from Authenticator to EventListener for member ID generation #54
No reviewers
Labels
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
datakollektivet/systemer!54
Loading…
Reference in a new issue
No description provided.
Delete branch "member-id-event-listener"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I propose to change from an
Authenticatorto anEventListenerProviderfor automatic generation of member IDs. The main reasons for this change are:Besides that, the event listener interfaces are generally simpler to implement and setup is easier. If I understood correctly, Keycloak does not have built-in functionality for welcome-emails anyway, so in a custom solution we might be able to wait for the member ID to be generated before sending any emails. Otherwise, the email could simply prompt the user to log into their account to retrieve their member ID.
I don’t have my computer to test this so I gave only reviewed the code.
I am a bit surprised that the validation logic doesn’t prevent a user being created by either an admin or a self registration. If you have tested this and it works then I think this is a good change so that the IDs are generated for admin create users as well.
@gingermusketeer wrote in #54 (comment):
I'm not sure what you mean with that? I have tested creating a user from admin and via registration form and the member ID is generated in both cases. Email verification also works with mailtrap now.
@luisa wrote in #54 (comment):
When we first tested creating users as admins we had a validation error due to required fields not being editable. I was assuming the same would be the case for the member id field but I see now that it isn’t a required field. No other system needs to know about the id so I don’t think it is an issue leaving it as not required for now. We can investigate alternatives if we end up with missing member IDs or needing to make it a required field.