Custom user profile fields mapping in Oauth2

Custom user profile fields mapping in Oauth2

by Mario Rotta -
Number of replies: 0

I'm trying to configure and activate an authentication instance via Oauth2 in a Moodle 3.4. 

All seems working fine: users can log in with their corporate CRM accounts and Moodle creates the user profile getting the essential informations (such firstname, lastname, email) from the external service. But our goal is also to get other data from the corporate CRM. So, we created some custom user profile fields in Moodle, to get specific values from the CRM data fields. But we don't know how to get the informations we need: while Oauth2 seems to map in a correct way some standard fields, we cannot map the custom fields we added to the user profile, so the service does not pass the value requested. No errors, but when Moodle creates users logged via the external service it gets only the values of the firstname, lastname and email. No more.

Searching in forums and documentation I did not find any useful suggestion to solve the problem. I tried also to modify the code of the api.php file of the Oauth2 plugin according to this tracker issue: https://tracker.moodle.org/browse/MDL-59115. But the only advantage we got was a way to map manually the optional standard fields, while the custom fields are still unidentified.

The question is: how can we map the custom user profile fields we added in moodle ad tell to the plugin to pass the values of the matching external fields? In the mapping options the list of internal fields is locked. How can we add to the list our custom fields?

THak You in advance for any suggestion
Mario Rotta

Average of ratings: Useful (1)