- Issue created by @jerrac
- π¦πΊAustralia lykyd
Hello,
To be able to map your custom fields to drupal fields you will have to create custom claims.
Create a custom module and in its .module file (ex : yourmodule.module) you have to implement the g2f_account_openid_connect_claims_alter* Implements hook_openid_connect_userinfo_claim_alter() */ function yourmodule_openid_connect_claims_alter(array &$claims) { // Add custom claims to OpenID Connect administration $claims['custom_claim'] = [ 'scope' => 'profile', 'title' => 'Custom Claim', 'type' => 'string', 'description' => 'A custom claim from provider', ]; }
Then you should see "Custom Claim" in the "User claims mapping" form.
PS : the other hook you might need is the hook_openid_connect_userinfo_claim_alter that will help you to rework the values of the custom fields to match the expected values of your Drupal fields.
- πΊπΈUnited States jerrac
I actually did end up implementing hook_openid_connect_claims_alter() and hook_openid_connect_userinfo_alter() to get what I needed. I just left this open because it seems like adding custom scopes should be possible via the UI. Though, judging from the lack of response up until now, it actually isn't, and likely won't be added.
Man, I sure wish I had the money to pay for stuff like this to get added. Or the justification for spending the time implementing it myself.
Anyway, I'm going to leave this open for now. But I won't complain if the maintainers close it as "won't fix" or something.