As the module work right now it does not fill out the name field in Discourse with anything but a split-up version of username.
To add full/real name I did the following:
1. add field to user, ie. Name (machine name field_name)
2. in /discourse_sso.module, add 'name' to payload, extract value of field with $account-function on line 39
Lines 50-56:
$return_payload = base64_encode(http_build_query(array(
'username' => $user->getAccountName(),
'external_id' => $user->id(),
// add this line below!
'name' => $account->field_name->value,
'email' => $user->getEmail(),
'avatar_force_update' => true,
'avatar_url' => $picture,3. configure Discourse to lock local changes (Settings>Username>sso overrides name)
Comments
Comment #2
myram commentedComment #4
boromino commentedComment #5
boromino commentedSelect the user field to use in Drupal Discourse SSO settings.