Username displayed in Drupal admin not correct

I just have the links as referenced above at Username displayed in Drupal admin not correct - #2 by mathiasconradt , not more info.

Best to check what claim from the ID token Drupal (or the Drupal plugin) relies on, and then first check if the user profile within Auth0 itself is correct as needed, i.e. whether the user.name and user.username claim has been set as wanted via the Rule. That can be seen in the Auth0 Users Detail > Raw JSON.
The Rule code is simple NodeJS code, can be debugged with the Webtask Realtime Debugger.

“That can be seen in the Auth0 Users Detail > Raw JSON.” I think this is beyond what I can do. If I give you access, could you check on that please?

or let me send you that report

This is from the user that I just created:

{
    "created_at": "2020-03-27T08:33:30.436Z",
    "email": "rmttchr@gmail.com",
    "email_verified": true,
    "identities": [
        {
            "user_id": "5e7dba5ab3e8e20c7a8f1d44",
            "provider": "auth0",
            "connection": "Username-Password-Authentication",
            "isSocial": false
        }
    ],
    "name": "teacher",
    "nickname": "rmttchr",
    "picture": "https://s.gravatar.com/avatar/7ca931da118a9cf047a4071efa44b124?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Frm.png",
    "updated_at": "2020-03-27T08:43:55.589Z",
    "user_id": "auth0|5e7dba5ab3e8e20c7a8f1d44",
    "username": "teacher",
    "last_ip": "71.207.156.47",
    "last_login": "2020-03-27T08:43:55.589Z",
    "logins_count": 2,
    "blocked_for": [],
    "guardian_authenticators": []
}

I wanted the username to be “teacher”, what is represented here as “nickname”. Could you please modify that code to achieve this?

I see

“username”: “teacher”,

just fine 4 lines beneath nickname. So, all as expected, not? Or do you mean name ?

The username in Drupal is showing “rmttchr”, instead of “teacher”.

Ok I see.

In this case, adjust the rule logic accordingly:

change line

var data = { name : user.username };

to

var data = { nickname : user.username };

You edited that on the main code? I will just update the whole code?

I’m referring to my original rule code as above. Just change that one line in it.

OK, let me do that and test. give me two minutes.

It works. Thank you very much!!!
Question: After every version update, should I edit the role with the new version? Could that update/change automatically?
Thanks!

You can keep it at 2.9.1 for that particular rule (it doesn’t update automatically, but it’ll remain working for that rule and that version is to stay, even with newer upgrades available).

Where do I do to check on the version, just in case?

You can check for the latest available version at Can I require? - Search which node modules you can use in webtask.io

Btw: I just see that 2.9.1 isn’t actually the latest version, there’s a newer 2.19.0 out, feel free to use that.

Hello, I have also noticed that when users change their password in Drupal, Auth0 doesn’t allow them to login with that password. How can this be resolved?

I don’t know how the Drupal plugin works, whether it actually updates the Auth0 password or not (I doubt it, since that would require an access token to the Auth0 mgmt API, which I guess hasn’t been configured anywhere).
I think that password change and user is referring to a local user / local login.

But that really depends on the Drupal plugin, not much we know about it or can solve, I would ask this in the Drupal forum, or the respective plugin website.

Is that a particular Drupal plugin you’re using, or a core functionality of Drupal itself? Can you provide a link? But as said, most likely nothing that Auth0 users can help with unless they’re familiar with Drupal as well.

Do you have an Auth0 url link where I can redirect users to go to and edit their credentials, such as the password?

The Authentication API provides a link to the password reset:

https://auth0.com/docs/api/authentication#change-password

I can’t locate a link. This is what it shows:

POST https://YOUR_DOMAIN/dbconnections/change_password
Content-Type: application/json
{
  "client_id": "YOUR_CLIENT_ID",
  "email": "EMAIL",
  "connection": "CONNECTION",
}