Set a Custom Redirect Target with OAuth SSO - HL Vanilla Community
<main> <article class="userContent"> <p>Do you need to add a URL in your community that links a user to a specific piece of content? Do you have the additional stipulation that the user must first be signed in? This requires more than a typical link: the URL must be formatted with a sign in link.</p><ul><li>To do this with OAuth 2 SSO, you must add a special state parameter with the target. </li></ul><p>Here is the basic process:</p><ol><li>Make a JSON object with a <code class="code codeInline" spellcheck="false" tabindex="0">target</code> key that points to the URL you want the user redirected to after they sign in.</li><li>Base 64 encode your JSON string.</li><li>Pass that value to the <code class="code codeInline" spellcheck="false" tabindex="0">state</code> query string parameter of <code class="code codeInline" spellcheck="false" tabindex="0">/entry/oauth2-redirect</code> .</li></ol><p>This URL will send the user to your authenticate page, and then redirect them to the appropriate place after they've authenticated against your OAuth 2 server.</p><p><strong>📝 NOTE</strong>: This should work for custom OAuth 2 addons by substituting your custom key for <code class="code codeInline" spellcheck="false" tabindex="0">oauth2</code> in <code class="code codeInline" spellcheck="false" tabindex="0">/entry/oauth2-redirect</code> .</p> </article> </main>