This article describes how to pass additional user-profile data when connecting users via SSO.
Let's walk through how to set it up.
Create a field
1. Navigate to the Settings > Membership > User Profile page.
2. Click Add Field and set the following.
Type
- Choose Single Textbox; this accepts text strings.
Label
Registration Options
3. Click Save and verify that your new field is included in the list of Custom Profile Fields.
To learn about the other fields that you can set, see:
Pass the User Profile data
The key of the profile field being sent is simply the Label with any non-number and letters removed. The maximum number of characters is 50.
🛑 IMPORTANT: The field is case-sensitive. So to capture user data for, example, Player Level, you would have to send it as PlayerLevel. If you created a field with a label Top "Rate" to-date!, you would have to send it as TopRatetodate. An example of an OAuth2 response that would pass values to these profile fields:
{
"Email": "ian@example.com",
"Photo": "https://cdn.ouravatars.com/avatar/1fa90f330a58f5d.png",
"Name": "Ian",
"FullName": "Ian Devloper",
"UniqueID": "fa0e81fa65e8",
"PlayerLevel": "Novice",
"TopRatetodate": "11",
"email_verified": true,
"Provider": "oauth2"
}
Remember, it's case-sensitive. If you send "playerlevel":"Novice",
it will not throw an error but it will not pass the Player Level to the user's profile.
Troubleshooting
This is important: Once the field has been created, it has been saved with the transformed Label as its key (e.g., "PlayerLevel").
- If you change the Label, the key remains the same.
- If you edit the "Player Level" field in the Profile Extender addon settings and change its name to "Player Status," its key remains "PlayerLevel"; otherwise, data would be orphaned. If you want to change the key, you have to delete the field and create a new one.
If you don't know what the key is (e.g., you have edited it several times or the profile data is not being assigned to the user), one way to verify what the profile key is is to go to /entry/register
and look at the source of the field you're looking for.
https://us.v-cdn.net/6030677/uploads/055/Screen Shot 2020-05-05 at 5.30.57 PM.png
If you can't get to /entry/register
, it's because you're using your SSO method as the default method of connecting to the site and we won't allow users to register through our page.
- Go into the settings page of the SSO addon you're using in the Dashboard and temporarily un-set it as the default method. After you have verified the field name, set it back as the default.