0

I have configured OAuth2 service in Moodle and after a success login from OAuth2, it redirects me to edit user profile page for new user and only email is prefilled as the OAuth2 issuer only provides openid and mail scopes, I couldn't directly retrieve user profile from the callback and prefill First Name, Last Name and other user info fields. So, how should I configure it in Moodle website or in the backend code to call

https://{oauthurl}/oauth/v1/token

in order to get the access token and after that retrieve user info by calling

https://{oauthurl}/oauth/v1/userinfo

?

doremi666
  • 121
  • 3
  • 15

1 Answers1

0

Locked fields

Do you have the fields unlocked in Moodle ? If they are locked then the fields aren't updated.

Go to Site administration > Plugins > Authentication > OAuth 2 > Settings

Or direct to admin/settings.php?section=authsettingoauth2

Mapped fields

Also, you can map the fields in Moodle to the Oauth2 service

Go to Site administration > Server > OAuth 2 services

Or direct to /admin/tool/oauth2/issuers.php

Edit the service and then update the field mapping

Russell England
  • 9,436
  • 1
  • 27
  • 41