Auth0 Home Blog Docs

Worpress frontend login and registration

wordpress

#1

This is probably a really simple and or silly question but I am having problems determining how to publish the Auth0 plugin for frontend login and registration. We’d like to do it from a small top menu but I’m having no success using the shortcode.

The plugin is installed and is working for administration login but I’m not clear how to deploy Auth0 for frontend user registration and login.


#2

I’m assuming you disabled the WordPress login enabled toggle so you have all logins going through Auth0. In this situation, by default, the user that logged in from Auth0 will be matched using the user identifier or email address to see if it already exists as an WordPress user. If it doesn’t then it will be created (also assuming you enabled the correct membership options to allow anyone to register).

If a user matches by user identifier or verified email address then it will use the already existing WordPress user. So when you start, if you have the admin user with email john@example.com and you enable Auth0 login then to login as admin you’ll need to login at Auth0 with a user that has that verified email.

For regular users it’s basically the same thing, but since they login with emails different then john@example.com they will be treated as regular users and not administrators.

With this in mind any simple link to http://example.com/wp-login.php would allow both administrator and regular users to login through Auth0 (the permission they would obtain would depend on the permissions assigned to the WordPress user to which they would be matched). A user logging in with a verified email associated with an administrator would have those permissions while other user would have the regular permission.

You can indeed use the shortcode approach if you want to provide some custom options specific to that top bar action, however, if you don’t need to have multiple login entry points using different initialization options then you should be able to just provide all the options you desire through the plugin configuration and then just have a link pointing to the login page.


#3

Thanks that was very helpful.


#4

Thanks that was very helpful.


#5