• Dear Justin,
    thank you for this great plugin! I’ve followed your video on setting up WordPress authentication for Moodle and it’s working just fine.

    Now I’d like to fill in the first and last name automatically, so users aren’t prompted for their details the first time they log into Moodle.

    I’m requesting the (default) scopes of “openid profile email” and using the mapping:
    given_name -> firstname
    family_name -> lastname

    However, users are still prompted for their name. Any idea what I am missing?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Justin Greer

    (@justingreerbbi)

    Hi @ynick, sorry for the issues. I will have to look into the codebase more for Moodle to see what is going on there before I could answer anything about the actual mapping.

    If you are confident that the OAuth Server from WordPress is sending out the first and last names as you would like, it must be with the mapping in Moodle. It could very well be the naming for the mapping in the Moodle settings. You can find these in the OAuth 2 configuration settings for the client in moodle.

    Hi Justin, I have the same query. I have setup the Oauth as per your video and its working fine. However, I would like to know how I can map first name and last name fields in WP+Woocommerce to Moodle.

    I just got this working. In your plugin folder ( wp-content/plugins/oauth2-provider ) there is an “example.php”

    The last example in that file is a filter to add first and last names to the response from /oauth/me. You need to copy this code into the functions.php file in your theme. (or use the “theme-customisations” plugin so you don’t have to fix your functions.php every time you upgrade your theme.)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Mapping of profile fields’ is closed to new replies.