Important error – mixing identities
-
Hi @auth0josh,
I’ve found this error using Login by Auth0 wordpress plugin but I can recreate it with Auth0 API.
Using Auth0 API I can get user by id, the problem is, that the same id is used among different database connections but getting the user by id I don’t specify which connection I want to use therefore I can get wrong identity.
For example:
I have one email address and I use it to create accounts in different database connections (one email address has many identities).
Using the API /api/v2/users-by-email I pass ‘[email protected]’ and I get something like this:
[ { "username": "foo_1", "email": "[email protected]", "user_id": "auth0|1", ... "identities": [ { "user_id": "1", "provider": "auth0", "connection": "CONNECTION_1", "isSocial": false } ], ... }, { "nickname": "foo_2", "email": "[email protected]", "user_id": "auth0|1" ... "identities": [ { "user_id": "1", "provider": "auth0", "connection": "CONNECTION_2", "isSocial": false } ], ... }, { "email": "[email protected]", "name": "foo_3", "user_id": "auth0|1", ... "identities": [ { "user_id": "1", "provider": "auth0", "connection": "CONNECTION_3", "isSocial": false } ], ... } ]Then I run GET
/api/v2/users/{id}and pass auth0|1 and get one of the three identities. I don’t have to specify which connection to use:{ "nickname": "foo_2", "email": "[email protected]", "user_id": "auth0|1", ... "identities": [ { "user_id": "1", "provider": "auth0", "connection": "CONNECTION_2", "isSocial": false } ], ... }This error affected my wordpress sites too.
Recently I’ve set up new wordpress installation with Auth0 plugin. I’ve registered new user account there (let’s say [email protected]) and I’ve found that I cannot log in there. I’ve changed passsword and logged into that account only to find that wordpress is showing me another identity form another connection that was disabled for this application (let’s say [email protected]).In Auth0 dashboard, in logs section I’ve found that [email protected] was logging to my new wordpress. In Auth0 dashboard users section I’ve also had [email protected] at the top of the list but when I’ve clicked I saw the [email protected] identity and in [email protected] account History section I saw logs indicating that this account logged to my new wp site too. The get_user and login migration scripts were returning the identity for [email protected]
The topic ‘Important error – mixing identities’ is closed to new replies.