User registration
Added by Edwin Bentley over 11 years ago
Hi there,
One of fellow developers posted an issue (#2656).
We're after some example of adding and registering users using email verification.
We basically want an admin user to add a user, which will then email them an auth token of some sort so that they can then authenticate and immediately change their password.
Do you have anything that would show how we would go about this, or would you be able to create something for us?
Thanks.
Replies (3)
RE: User registration - Added by Koen Deforche over 11 years ago
Hey,
That sounds like a useful way to register users in a new project; we've actually implemented this already for a customer.
To let an admin add a new user, you should use code similar to what's done in the blog example:
https://github.com/kdeforche/wt/blob/master/examples/blog/model/BlogSession.C#L128
But instead of giving a password, you then should send an email with a token, for which you can use AuthService::lostPassword() to send of the email.
If you use an AuthWidget with AuthModel as in the standard examples (feature/auth1 or feature/auth2), then authWidget->processEnvironment() will show the UpdatePasswordDialog for users to enter their password.
Regards,
koen
RE: User registration - Added by Edwin Bentley over 11 years ago
Hi Koen,
Thanks for the reply, that pointed us in the right direction.
Another question related to authentication, we're looking at integrating authenticating against Active Directory using LDAP.
We have this set up in a class to do this, checking first whether the user is in a group that can login, and then binding the user with a password they provide.
First question - is it possible to have both local database users, with passwords configured, as well as just auth identities with the authentication then handled by our LDAP class - this way user management can be handled by an existing Active Directory or LDAP server.
My initial thought from looking at the Auth module is that it should be possible, but it would be great if you could point us in the right direction.
Regards,
Edwin
RE: User registration - Added by Koen Deforche over 11 years ago
Hey,
I'm not really experienced with LDAP, but you can for example specialize the password verifier, or the user database, depending on what makes most sense (I guess both are perhaps needed?). The specialization could then combine both a local and remote user database?
The proof of the pudding is in the eating, obviously, and if there are things that need to be changed in our API to support, this we're more than willing to help.
Regards,
koen