Expanding User SSO IDs - HL Vanilla Community
<main> <article class="userContent"> <p>When calling the <strong>API v2</strong>, you can use <a href="https://success.vanillaforums.com/kb/articles/46-smart-ids" rel="nofollow noreferrer ugc">smart IDs</a> to pass your SSO IDs into the API as parameters. However, what if you want to get your SSO IDs <em>out</em> of the API? In this case, you can use the <code class="code codeInline" spellcheck="false" tabindex="0">ssoID</code> expand parameter on API endpoints.</p><ul><li>Here's how it works. Anytime you see an expand parameter that involves a user, you can specify <em>another </em>expand parameter by appending <code class="code codeInline" spellcheck="false" tabindex="0">.ssoID</code> to the end. </li></ul><p><strong>⭐️ EXAMPLE</strong>: I see that the <code class="code codeInline" spellcheck="false" tabindex="0">GET /discussions</code> endpoint has an <code class="code codeInline" spellcheck="false" tabindex="0">insertUser</code> expand parameter. I can also specify <code class="code codeInline" spellcheck="false" tabindex="0">insertUser.ssoID</code> to get that user's SSO ID. The call would look like this:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">GET https://example.com/api/v2/discussions?expand=insertUser,insertUser.ssoID </pre><p>This would return an API result like this:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">[ { "discussionID": 123, "name": "Some discussion title", ..., "insertUser": { "userID": 234, "name": "username", "photoUrl": "https://example.com/avatar.jpg", "dateLastActive": "2020-05-05T12:55:33.304Z", "ssoID": "<your site's ID here>" } }, ... ] </pre><h2 data-id="what-sso-id-is-expanded">What SSO ID is expanded?</h2><p>In order to have an SSO ID <em>expanded</em>, you must have a default SSO method <em>selected</em>. The IDs from the default SSO provider are used.</p><h2 data-id="sso-id-permissions">SSO ID permissions</h2><p>SSO IDs require <strong>permission </strong>to view. To manage the level of permissions for SSO IDs:</p><ol><li>Access the Dashboard.</li><li>Navigate to <strong>Settings > Membership > Roles & Permissions</strong>.</li><li>Click the <strong>Advanced Settings</strong> button at the top right (to the left of the Add Role button).</li><li>Select a Role in the <strong>API SSO Expand Permission</strong> dropdown.</li><li>Click <strong>Save</strong>.</li></ol><div class="embedExternal embedImage display-large float-none"> <div class="embedExternal-content"> <a class="embedImage-link" href="https://us.v-cdn.net/6030677/uploads/290/Roles___Permissions_%E2%80%94_T1.png" rel="nofollow noreferrer noopener ugc" target="_blank"> <img class="embedImage-img" src="https://us.v-cdn.net/6030677/uploads/290/Roles___Permissions_%E2%80%94_T1.png" alt="Untitled Image" height="550" width="2072" loading="lazy" data-display-size="large" data-float="none"></img></a> </div> </div> <p><br></p> </article> </main>