Passing Extra Profile Data Over SSO - Vanilla Success
<main> <article class="userContent"> <p>Sometimes you want to pass extra user profile data when connecting users over SSO. All of our SSO methods integrate with our Profile Extender Addon. This is applicable regardless which SSO method you are using. Here is how you set it up:</p><h4 data-id="turn-on-profile-extender-addon">Turn on Profile Extender Addon</h4><div class="embedExternal embedImage"> <div class="embedExternal-content"> <a class="embedImage-link" href="https://us.v-cdn.net/6030677/uploads/7857OB80PJ9J/screen-shot-2020-05-05-at-4-17-27-pm.png" rel="nofollow noreferrer noopener ugc" target="_blank"> <img class="embedImage-img" src="https://us.v-cdn.net/6030677/uploads/7857OB80PJ9J/screen-shot-2020-05-05-at-4-17-27-pm.png" alt="Screen Shot 2020-05-05 at 4.17.27 PM.png" /> </a> </div> </div> <h4 data-id="create-a-field">Create a Field</h4><div class="embedExternal embedImage"> <div class="embedExternal-content"> <a class="embedImage-link" href="https://us.v-cdn.net/6030677/uploads/36N9VROCX4DK/screen-shot-2020-05-05-at-4-21-49-pm.png" rel="nofollow noreferrer noopener ugc" target="_blank"> <img class="embedImage-img" src="https://us.v-cdn.net/6030677/uploads/36N9VROCX4DK/screen-shot-2020-05-05-at-4-21-49-pm.png" alt="Screen Shot 2020-05-05 at 4.21.49 PM.png" /> </a> </div> </div> <p><br></p><p>Make sure that you check "<strong>Show on Registration</strong>". It will not show if you are passing all the required data to complete the SSO connection but it will receive the values you pass. If, however your connection flow is interrupted in order to prompt users to add a Username or Email address these questions will show. If you do not want users to be able to input data in these fields during SSO connection you can hide them with CSS.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">.Dashboard.Entry .Connect li.form-group { display: none; } </pre><p> Note that checking "<strong>Required for all users</strong>" is only applied when users register using our native registration page, not over SSO. That is to say, we do not validate SSO profile data for Profile Extender fields. If you pass nothing, we will not throw an error. "<strong>Show on profiles</strong>" means that this data will be displayed on the user's profile page.</p><p>Use only the <strong>TextBox</strong> type which accepts Strings.</p><h4 data-id="pass-the-user-profile-data">Pass the User Profile Data </h4><p>The <strong>key</strong> of the profile field being sent is simply the <strong>Label</strong> with any non-number and letters removed. The maximum of characters is 50. Important: the field is <strong>case-sensitive</strong>. So to capture user data for the above example, <strong>Player Level</strong>, you would have to send it as <strong>PlayerLevel.</strong> If you created a field with a label <strong>Top "Rate" to-date!</strong>, you would have to send it as <strong>TopRatetodate.</strong> An example of an OAuth2 response that would pass values to these profile fields:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">{ "Email": "ian@example.com", "Photo": "https://cdn.ouravatars.com/avatar/1fa90f330a58f5d.png", "Name": "Ian", "FullName": "Ian Devloper", "UniqueID": "fa0e81fa65e8", "PlayerLevel": "Noob", "TopRatetodate": "11", "email_verified": true, "Provider": "oauth2" } </pre><p>Remember, it's case sensitive. If you send <code class="code codeInline" spellcheck="false" tabindex="0">"playerlevel":"Noob",</code> it will not throw an error but it will not pass the Player Level to the user's profile.</p><h2 data-id="trouble-shooting">Trouble shooting</h2><p>Careful. Once the field has been created it has been saved with the transformed Label as its key (i.e. "PlayerLevel"). If you change the Label the key remains the same. If you edit the "Player Level" field in the Profile Extender Addon 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.</p><p>If you don't know what the key is (say, if 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 <code class="code codeInline" spellcheck="false" tabindex="0">/entry/register</code> and look at the source of the field you are looking for.</p><a href="https://us.v-cdn.net/6030677/uploads/055/Screen Shot 2020-05-05 at 5.30.57 PM.png" data-embedJson="{"url":"https:\/\/us.v-cdn.net\/6030677\/uploads\/055\/Screen Shot 2020-05-05 at 5.30.57 PM.png","name":"Screen Shot 2020-05-05 at 5.30.57 PM.png","type":"image\/png","size":244481,"width":1756,"height":972,"mediaID":788,"dateInserted":"2020-05-05T21:32:22+00:00","insertUserID":47,"foreignType":"embed","foreignID":47,"embedType":"image"}" class="embedLinkLoader" rel="nofollow noreferrer ugc" > https://us.v-cdn.net/6030677/uploads/055/Screen Shot 2020-05-05 at 5.30.57 PM.png <svg class="embedLinkLoader-failIcon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"> <title>There was an error displaying this embed.</title> <circle cx="8" cy="8" r="8" style="fill: #f5af15"/> <circle cx="8" cy="8" r="7.5" style="fill: none;stroke: #000;stroke-opacity: 0.122"/> <path d="M11,10.4V8h2v2.4L12.8,13H11.3Zm0,4h2v2H11Z" transform="translate(-4 -4)" style="fill: #fff"/> </svg> </a> <p>Can't get to <code class="code codeInline" spellcheck="false" tabindex="0">/entry/register</code> ? That's because you are 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 your are 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.</p> </article> </main>