Support » Plugin: Login by Auth0 » Invalid username and password

  • Resolved Hasan Tariq

    (@hasantar)


    Hi there,

    I have installed the plugin on 3 WordPress sites. All running latest versions.

    Sign in works perfectly fine for all the users which were already in the WordPress database BEFORE the plugin was installed.

    If I go in and add a new user from the WordPress backend, it won’t login using the widget. If you login via the WordPress login, it lets you through.

    The Auth0 log inside WordPress is empty. The log in the Auth0 dashboard has two entries relating to this:

    Failed Login (invalid email/username)
    Failed cross origin authentication

    Interestingly, if go in and check the database connection from inside the Auth0 using this new user I just created, that works and the user gets migrated in to Auth0.

    However, it still won’t let you login with that user from the widget.

    Can you assist please.

    • This topic was modified 3 years, 12 months ago by Hasan Tariq.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Josh C

    (@auth0josh)

    @hasan

    If I go in and add a new user from the WordPress backend, it won’t login using the widget. If you login via the WordPress login, it lets you through.

    At the moment, users created in WordPress are not sent to Auth0. You should create them in Auth0 first and, when they log in, they will be created in WordPress automatically.

    Thread Starter Hasan Tariq

    (@hasantar)

    Hi Josh,

    Thanks for your reply.

    So can you confirm the first time I setup the plugin on an existing site, lets say with thousands of users, all of those will get migrated in to Auth0?

    Is it possible to manually run the migration periodically to update the database?

    Thanks,

    Hasan

    • This reply was modified 3 years, 12 months ago by Hasan Tariq.
    Plugin Contributor Josh C

    (@auth0josh)

    @hasantar

    If you use the database migration, they will be migrated to Auth0 as they login. Otherwise, you can import using an extension (https://auth0.com/docs/extensions/user-import-export) or using the Management API (https://auth0.com/docs/users/migrations/bulk-import). Using one of the latter 2 options, you should only need to do that once and then new signups will come through Auth0 first.

    Thread Starter Hasan Tariq

    (@hasantar)

    Hi @auth0josh,

    I have auth0 working across 4 sites. But there is one thing I am struggling with if you can shed some light on this.

    Let’s say I have 4 sites. Each site has its own users (in thousands). 50% of those users also have accounts on other sites in the group. They have all signed up independently for each site. The email address would be the same but password could be different.

    Now I want to use auth0 across the 4 sites and offer SSO to all users across the sites.

    What I am struggling with is the database connections from the auth0 dashboard.

    Should each application (of 4), have access to all the databases of the others? So each app has access to 4 databases. I have tried this but this doesn’t work and only the top-most database in the list gets queried and the login doesn’t work if the source of users is from one of the other databases. It throws an invalid password error and I can see in the log it is using the wrong database.

    Or:

    Should each application (of 4), have access to only 1 database, the same database? So I disable the other 3 databases and only use 1. The problem with this approach is, existing users created via one of the other databases can’t log in.

    Thanks, will appreciate your help on this.

    Plugin Contributor Josh C

    (@auth0josh)

    @hasantar – happy to help.

    As you saw, you can’t authenticate against multiple database connections. It’s one DB per Application (not one application per DB).

    So, with that in mind, if you want the same user to be recognized across those applications, then they all need to be stored in the same database with the same user data. That means that they all need to be normalized, in that they all need the same information (including password). That might require a password reset for some of the users.

    Otherwise, if you have separate databases for the separate applications then the users will have different Auth0 user IDs and cannot use the same email address across the different sites.

    Hope that helped. Let me know if you need anything else here!

    Thread Starter Hasan Tariq

    (@hasantar)

    Hi @auth0josh,

    Many thanks for your reply. All makes sense now.

    Last question, given that I need to use the same database for all applications to share users:

    What is the recommended workflow when setting up the plugin on a new site?

    Should I run the wizard as a new install with user migration on each site and then switch the database from the Auth0 dashboard?

    OR

    Should I use the import settings option in the wizard on first install. Is that option for importing options in to another instance of the same site or to add an additional site to the same network of sites with the same database connection. Which is my use case.

    Thanks

    • This reply was modified 3 years, 11 months ago by Hasan Tariq.
    • This reply was modified 3 years, 11 months ago by Hasan Tariq.
    • This reply was modified 3 years, 11 months ago by Hasan Tariq.
    Plugin Contributor Josh C

    (@auth0josh)

    If you run the setup wizard, it will create a new Application and database Connection, which you don’t want to do in your case. You can use the import settings if you want everything to be the same but you’ll need to switch the Client ID and Secret for the sites that you import (you should have a different Application for each site). Steps for manually setting up an Application are here:

    https://auth0.com/docs/cms/wordpress/configuration

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Invalid username and password’ is closed to new replies.