{"componentChunkName":"component---src-templates-tag-js","path":"/tags/login-radius/","result":{"data":{"site":{"siteMetadata":{"title":"LoginRadius Blog"}},"allMarkdownRemark":{"totalCount":20,"edges":[{"node":{"fields":{"slug":"/engineering/implementing-oidc-sso-loginradius-as-identity-provider/"},"html":"<p>First, let's understand:</p>\n<ul>\n<li>What is SSO, and why should you use it?</li>\n<li>What is OIDC, and why is it used for authentication?</li>\n<li>How can you leverage LoginRadius as an identity provider?</li>\n</ul>\n<p><strong>SSO stands for Single Sign-On</strong>. It's an authentication process that allows a user to access multiple applications or systems with one set of login credentials (username and password). Instead of requiring users to log in separately to each application, SSO enables them to log in once and gain access to all the connected systems without needing to re-enter their credentials.</p>\n<p><strong>OpenID Connect (OIDC)</strong> is a protocol that builds on OAuth 2.0 to ensure secure user authentication and authorization. It adds an identity layer to OAuth 2.0, allowing applications to confirm a user's identity and gather basic profile information. OIDC utilizes JSON Web Tokens (JWTs) for these functions, aligning with OAuth 2.0's token acquisition methods. This integration enables seamless user authentication across different platforms, supporting features like single sign-on, where users can access multiple applications with one set of credentials managed by an identity provider.</p>\n<h2 id=\"what-is-loginradius-ciam\" style=\"position:relative;\"><a href=\"#what-is-loginradius-ciam\" aria-label=\"what is loginradius ciam permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is LoginRadius CIAM?</h2>\n<p>LoginRadius is a high-performance, scalable identity and access management platform focused on customer-facing use cases. It offers comprehensive features and capabilities to help you implement user authentication and authorization and manage user data with built-in workflows and security controls. </p>\n<p>On these lines, LoginRadius offers built-in support for OIDC and the use of OIDC to implement SSO.</p>\n<p>First, you need to create an OIDC application in LoginRadius to tailor user claim fields effortlessly. You can fine-tune these customizable user claims through LoginRadius' user-friendly interface. Subsequently, you can seamlessly integrate these claims into the token, enabling streamlined extraction and utilization within the application ecosystem.</p>\n<p>In essence, LoginRadius facilitates the setup of OIDC applications and offers customization capabilities through its intuitive interface. This ensures efficient management of user claims, ultimately contributing to a more personalized and secure authentication experience.</p>\n<p>After setting up the OIDC app from the LoginRadius dashboard, you'll use the <a href=\"https://github.com/coreos/go-oidc\"><code>go-oidc</code> library</a> to configure our provider further and configure the oidc connect.</p>\n<h2 id=\"setting-up-oidc-application-in-loginradius\" style=\"position:relative;\"><a href=\"#setting-up-oidc-application-in-loginradius\" aria-label=\"setting up oidc application in loginradius permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Setting Up OIDC Application in LoginRadius</h2>\n<p>Go to <a href=\"https://adminconsole.loginradius.com/platform-configuration/access-configuration/federated-sso/openid-connect\">OIDC Application Configuration</a> and click on <strong>Add App button</strong></p>\n<p><img src=\"/92a85a64e1a313e22d9a33bd141fa714/OIDC-App.webp\" alt=\"OIDC App Configuration\"></p>\n<p>Enter the <strong>App name</strong> and click one of the following:</p>\n<p><strong>Native App</strong>, <strong>Single page App</strong> or <strong>Web App</strong> according to your application.</p>\n<p><img src=\"/dc9d3f7635cd7f1a5ed3a5806e7b8317/App-Setup.webp\" alt=\"OIDC App Setup\"></p>\n<p>After clicking the <strong>Create</strong> button, you'll get the OIDC application configuration page. This page contains details like your application's <strong>Client ID</strong> and <strong>Client Secret</strong>, which are necessary for setting up the OIDC provider and configuration when you code in Golang.</p>\n<p><img src=\"/79919f23bcc8f66944360d3832a09bb7/App-Credentials.webp\" alt=\"OIDC APP Credentials\"></p>\n<h4 id=\"upon-reaching-the-configuration-page-for-your-oidc-application-youll-encounter-a-variety-of-fields-ripe-for-customization\" style=\"position:relative;\"><a href=\"#upon-reaching-the-configuration-page-for-your-oidc-application-youll-encounter-a-variety-of-fields-ripe-for-customization\" aria-label=\"upon reaching the configuration page for your oidc application youll encounter a variety of fields ripe for customization permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Upon reaching the configuration page for your OIDC Application, you'll encounter a variety of fields ripe for customization:</h4>\n<ol>\n<li><strong>Algorithm</strong>: Presently, we offer support for <strong>rs256</strong>.</li>\n<li><strong>Grant Type</strong>: Options include authorization code, implicit, password creds, etc.</li>\n<li>You can tailor settings for <strong>Token Expiry</strong>, <strong>Refresh Token</strong>, and <strong>TTL</strong> to suit your needs.</li>\n<li><strong>Data Mapping</strong>: Define fields or properties to be included in the data response.</li>\n<li><strong>Metadata</strong>: Incorporate static, non-profile values into the data response.</li>\n<li>Define the Scope for Management API.</li>\n</ol>\n<p>This array of configurable options empowers you to fine-tune your OIDC Application according to your specific requirements.</p>\n<h2 id=\"whitelisting-the-domain-of-your-application\" style=\"position:relative;\"><a href=\"#whitelisting-the-domain-of-your-application\" aria-label=\"whitelisting the domain of your application permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Whitelisting the Domain of Your Application</h2>\n<p>To ensure seamless redirection of requests and successful callbacks to your endpoint, add your application's domain to the whitelist. This will authorize the redirection process and prevent failures when calling the callback endpoint.</p>\n<h4 id=\"to-access-web-apps-in-deployment-follow-these-steps\" style=\"position:relative;\"><a href=\"#to-access-web-apps-in-deployment-follow-these-steps\" aria-label=\"to access web apps in deployment follow these steps permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>To access Web Apps in Deployment, follow these steps:</h4>\n<ol>\n<li>Navigate to the Deployment section from the Dashboard.</li>\n<li>Once in Deployment, select the Apps tab.</li>\n<li>From there, choose Web Apps.</li>\n</ol>\n<h4 id=\"now-to-add-a-new-site\" style=\"position:relative;\"><a href=\"#now-to-add-a-new-site\" aria-label=\"now to add a new site permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Now, to add a new site:</h4>\n<ol>\n<li>Click on the <strong>Add New Site</strong> button.</li>\n<li>Enter the domain name of the website (example: \"<code>https://localhost:8080</code>\").</li>\n</ol>\n<p><img src=\"/0baf77821f8c2128f1c1f044f1518959/Whitelisting-Domain.webp\" alt=\"Whitelisting Domain Name\"></p>\n<h3 id=\"whitelisting-domain-from-oidc-application-configuration\" style=\"position:relative;\"><a href=\"#whitelisting-domain-from-oidc-application-configuration\" aria-label=\"whitelisting domain from oidc application configuration permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Whitelisting Domain from OIDC Application Configuration</h3>\n<p>LoginRadius lets you uniquely identify the redirect URLs for individual OIDC applications:</p>\n<ul>\n<li>When setting the configuration of the OIDC Application, you can specify the redirect URL of your backend,\nand it will be whitelisted.</li>\n<li>The field name is <strong>Login Redirect URL</strong>.</li>\n</ul>\n<h2 id=\"setting-up-the-provider-object-and-the-oauthconfig-with-the-loginradius-oidc-app-credentials\" style=\"position:relative;\"><a href=\"#setting-up-the-provider-object-and-the-oauthconfig-with-the-loginradius-oidc-app-credentials\" aria-label=\"setting up the provider object and the oauthconfig with the loginradius oidc app credentials permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Setting Up the Provider Object and the OAuthconfig with the Loginradius OIDC App Credentials</h2>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">provider</span><span class=\"mtk1\">, err := </span><span class=\"mtk12\">oidc</span><span class=\"mtk1\">.</span><span class=\"mtk11\">NewProvider</span><span class=\"mtk1\">(</span><span class=\"mtk12\">ctx</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;`https://api.loginradius.com/{oidcappname}&quot;</span><span class=\"mtk1\">)</span><span class=\"mtk8\">`</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">if err != nil {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">    // handle error</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">// Configure an OpenID Connect aware OAuth2 client.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">oauth2Config := oauth2.Config{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">    ClientID:     your-oidc-clientID,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">    ClientSecret: your-oidc-clientSecret</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">    RedirectURL:  redirectURL,</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">    // Discovery returns the OAuth2 endpoints.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">    Endpoint: provider.Endpoint(),</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">    // &quot;openid&quot; is a required scope for OpenID Connect flows.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">    Scopes: []string{oidc.ScopeOpenID, &quot;profile&quot;, &quot;email&quot;},</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">}</span></span></code></pre>\n<p>When setting up a new provider, you'll need to input the LoginRadius OIDC App URL, typically in this format: <code>https://{siteUrl}/service/oidc/{OidcAppName}</code></p>\n<p>To seamlessly integrate this with your Go backend, create two essential APIs for setting up and configuring <code>go-oidc</code>:</p>\n<ol>\n<li><strong>Login Endpoint</strong>: This endpoint initiates the authentication process and redirects to the callback endpoint with the authorization code.</li>\n<li><strong>Callback Endpoint</strong>: Here, the authorization code received from the login endpoint is exchanged for an access token. Additionally, this endpoint extracts user claims from the access token.</li>\n</ol>\n<p>By establishing these APIs, your Go backend efficiently handles the authentication flow, ensuring a smooth user experience while securely managing user identity and access.</p>\n<h2 id=\"handle-the-callback-hit\" style=\"position:relative;\"><a href=\"#handle-the-callback-hit\" aria-label=\"handle the callback hit permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Handle the Callback Hit</h2>\n<p>Handle the callback hit that exchanged the authorization token for the access token:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">verifier</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">provider</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Verifier</span><span class=\"mtk1\">(&</span><span class=\"mtk12\">oidc</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Config</span><span class=\"mtk1\">{</span><span class=\"mtk12\">ClientID:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">clientID</span><span class=\"mtk1\">})</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">func</span><span class=\"mtk1\"> </span><span class=\"mtk11\">handleOAuth2Callback</span><span class=\"mtk1\">(</span><span class=\"mtk12\">ctx</span><span class=\"mtk1\"> *</span><span class=\"mtk12\">gin</span><span class=\"mtk1\">.</span><span class=\"mtk12\">context</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk3\">// Verify state and errors.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    authCode := </span><span class=\"mtk12\">ctx</span><span class=\"mtk1\">.</span><span class=\"mtk11\">query</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;code&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">oauth2Token</span><span class=\"mtk1\">, err := </span><span class=\"mtk12\">oauth2Config</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Exchange</span><span class=\"mtk1\">(</span><span class=\"mtk12\">ctx</span><span class=\"mtk1\">, </span><span class=\"mtk12\">authCode</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> </span><span class=\"mtk12\">err</span><span class=\"mtk1\"> != </span><span class=\"mtk12\">nil</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk3\">// handle error</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk3\">// Extract the ID Token from the OAuth2 token.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">rawIDToken</span><span class=\"mtk1\">, ok := </span><span class=\"mtk12\">oauth2Token</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Extra</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;id_token&quot;</span><span class=\"mtk1\">).(</span><span class=\"mtk12\">string</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> !</span><span class=\"mtk12\">ok</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk3\">// handle missing token</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk3\">// Parse and verify ID Token payload.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">idToken</span><span class=\"mtk1\">, err := </span><span class=\"mtk12\">verifier</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Verify</span><span class=\"mtk1\">(</span><span class=\"mtk12\">ctx</span><span class=\"mtk1\">, </span><span class=\"mtk12\">rawIDToken</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> </span><span class=\"mtk12\">err</span><span class=\"mtk1\"> != </span><span class=\"mtk12\">nil</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk3\">// handle error</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk3\">// Extract custom claims</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">claims</span><span class=\"mtk1\"> struct {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">Email</span><span class=\"mtk1\">    </span><span class=\"mtk12\">string</span><span class=\"mtk1\"> </span><span class=\"mtk8\">`json:&quot;email&quot;`</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">Verified</span><span class=\"mtk1\"> </span><span class=\"mtk12\">bool</span><span class=\"mtk1\">   </span><span class=\"mtk8\">`json:&quot;email_verified&quot;`</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> err := </span><span class=\"mtk12\">idToken</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Claims</span><span class=\"mtk1\">(&</span><span class=\"mtk12\">claims</span><span class=\"mtk1\">); </span><span class=\"mtk12\">err</span><span class=\"mtk1\"> != </span><span class=\"mtk12\">nil</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk3\">// handle error</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>For both endpoints, let's review a sample backend server with implementation in <a href=\"https://github.com/gin-gonic/gin\">Gin Golang</a>.</p>\n<h2 id=\"gin-golang-code\" style=\"position:relative;\"><a href=\"#gin-golang-code\" aria-label=\"gin golang code permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Gin Golang Code</h2>\n<p>For OIDC integration with the Go backend, you'll implement it using the <a href=\"https://github.com/coreos/go-oidc\">coreos/go-oidc</a> library (feel free to check it out). This library provides comprehensive support for OIDC, allowing to easily verify tokens, extract user claims, and validate ID tokens. Its features ensure secure authentication and seamless integration with various OIDC providers.</p>\n<p>With the <code>go-oidc</code> library, you can efficiently implement OIDC authentication in the Go backend, guaranteeing users a smooth and secure authentication process.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">go get github.com/coreos/go-oidc/v3/oidc</span></span></code></pre>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">package</span><span class=\"mtk1\"> </span><span class=\"mtk12\">main</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">import</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk8\">&quot;encoding/json&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk8\">&quot;fmt&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk8\">&quot;io&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk8\">&quot;log&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk8\">&quot;net/http&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk8\">&quot;os&quot;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk8\">&quot;github.com/coreos/go-oidc/v3/oidc&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk8\">&quot;github.com/gin-gonic/gin&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk8\">&quot;golang.org/x/oauth2&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Define global OAuth2 configuration and OIDC provider.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk12\">oauthConfig</span><span class=\"mtk1\"> = &</span><span class=\"mtk12\">oauth2</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Config</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\tClientID:     </span><span class=\"mtk8\">&quot;your-client-id&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk3\">// Replace with your LoginRadius Client ID</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\tRedirectURL:  </span><span class=\"mtk8\">&quot;http://localhost:8080/api/callback&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\tClientSecret: </span><span class=\"mtk8\">&quot;your-client-secret&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk3\">// Replace with your LoginRadius Client Secret</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\tScopes:       []</span><span class=\"mtk12\">string</span><span class=\"mtk1\">{</span><span class=\"mtk8\">&quot;user&quot;</span><span class=\"mtk1\">},</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk12\">globalProvider</span><span class=\"mtk1\">   *</span><span class=\"mtk12\">oidc</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Provider</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk12\">globalOuthConfig</span><span class=\"mtk1\"> *</span><span class=\"mtk12\">oauth2</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Config</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Server struct holds interfaces like HTTP server, DBHelper, ServerProvider, MongoDB client, etc.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">type</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Server</span><span class=\"mtk1\"> struct {</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// InitializeOAuthConfig sets up the global OAuth2 configuration and OIDC provider.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">func</span><span class=\"mtk1\"> </span><span class=\"mtk11\">InitializeOAuthConfig</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">// Create a new OIDC provider using the OAuth2 endpoint and OIDC provider URL.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk12\">provider</span><span class=\"mtk1\">, err := </span><span class=\"mtk12\">oidc</span><span class=\"mtk1\">.</span><span class=\"mtk11\">NewProvider</span><span class=\"mtk1\">(</span><span class=\"mtk12\">context</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Background</span><span class=\"mtk1\">(), </span><span class=\"mtk8\">&quot;https://&lt;siteUrl&gt;/service/oidc/&lt;OidcAppName&gt;&quot;</span><span class=\"mtk1\">) </span><span class=\"mtk3\">// Replace with your OIDC Provider URL</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk15\">if</span><span class=\"mtk1\"> </span><span class=\"mtk12\">err</span><span class=\"mtk1\">!= </span><span class=\"mtk12\">nil</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk12\">log</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Fatalf</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Failed to create new provider: %v&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">err</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk12\">globalProvider</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">provider</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">// Set up the OAuth2 configuration with the client ID, secret, redirect URL, and scopes.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\toauth2Config := &</span><span class=\"mtk12\">oauth2</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Config</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\tClientID:     </span><span class=\"mtk12\">oauthConfig</span><span class=\"mtk1\">.</span><span class=\"mtk12\">ClientID</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\tClientSecret: </span><span class=\"mtk12\">oauthConfig</span><span class=\"mtk1\">.</span><span class=\"mtk12\">ClientSecret</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\tRedirectURL:  </span><span class=\"mtk12\">oauthConfig</span><span class=\"mtk1\">.</span><span class=\"mtk12\">RedirectURL</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\tEndpoint:     </span><span class=\"mtk12\">provider</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Endpoint</span><span class=\"mtk1\">(),</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\tScopes:       []</span><span class=\"mtk12\">string</span><span class=\"mtk1\">{</span><span class=\"mtk12\">oidc</span><span class=\"mtk1\">.</span><span class=\"mtk12\">ScopeOpenID</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;profile&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;email&quot;</span><span class=\"mtk1\">},</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk12\">globalOuthConfig</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">oauth2Config</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// StartLoginProcess initiates the login process by redirecting the user to the OIDC provider.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">func</span><span class=\"mtk1\"> </span><span class=\"mtk11\">StartLoginProcess</span><span class=\"mtk1\">(</span><span class=\"mtk12\">ctx</span><span class=\"mtk1\"> *</span><span class=\"mtk12\">gin</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Context</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">// Generate the authorization URL for the OIDC provider.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\tauthURL := </span><span class=\"mtk12\">globalOuthConfig</span><span class=\"mtk1\">.</span><span class=\"mtk11\">AuthCodeURL</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;state&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">oidc</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Nonce</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\">))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">// Redirect the user to the OIDC provider for authentication.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk12\">http</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Redirect</span><span class=\"mtk1\">(</span><span class=\"mtk12\">ctx</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Writer</span><span class=\"mtk1\">, </span><span class=\"mtk12\">ctx</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Request</span><span class=\"mtk1\">, </span><span class=\"mtk12\">authURL</span><span class=\"mtk1\">, </span><span class=\"mtk12\">http</span><span class=\"mtk1\">.</span><span class=\"mtk12\">StatusFound</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// HandleCallback processes the callback from the OIDC provider after the user has authenticated.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">func</span><span class=\"mtk1\"> </span><span class=\"mtk11\">HandleCallback</span><span class=\"mtk1\">(</span><span class=\"mtk12\">ctx</span><span class=\"mtk1\"> *</span><span class=\"mtk12\">gin</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Context</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">// Retrieve the authorization code from the query parameters.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\tcode := </span><span class=\"mtk12\">ctx</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Query</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;code&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">// Exchange the authorization code for an access token.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk12\">oauth2Token</span><span class=\"mtk1\">, err := </span><span class=\"mtk12\">globalOuthConfig</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Exchange</span><span class=\"mtk1\">(</span><span class=\"mtk12\">ctx</span><span class=\"mtk1\">, </span><span class=\"mtk12\">code</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk15\">if</span><span class=\"mtk1\"> </span><span class=\"mtk12\">err</span><span class=\"mtk1\">!= </span><span class=\"mtk12\">nil</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk12\">log</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Printf</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Error exchanging code for token: %v&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">err</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk15\">return</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">// Extract the ID token from the OAuth2 token.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk12\">rawIDToken</span><span class=\"mtk1\">, ok := </span><span class=\"mtk12\">oauth2Token</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Extra</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;id_token&quot;</span><span class=\"mtk1\">).(</span><span class=\"mtk12\">string</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk15\">if</span><span class=\"mtk1\">!</span><span class=\"mtk12\">ok</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk12\">log</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Println</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Missing ID token&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk15\">return</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">// Verify the ID token using the OIDC provider.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">verifier</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">globalProvider</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Verifier</span><span class=\"mtk1\">(&</span><span class=\"mtk12\">oidc</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Config</span><span class=\"mtk1\">{</span><span class=\"mtk12\">ClientID:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">globalOuthConfig</span><span class=\"mtk1\">.</span><span class=\"mtk12\">ClientID</span><span class=\"mtk1\">, </span><span class=\"mtk12\">SkipClientIDCheck:</span><span class=\"mtk1\"> </span><span class=\"mtk4\">true</span><span class=\"mtk1\">})</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk12\">idToken</span><span class=\"mtk1\">, err := </span><span class=\"mtk12\">verifier</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Verify</span><span class=\"mtk1\">(</span><span class=\"mtk12\">ctx</span><span class=\"mtk1\">, </span><span class=\"mtk12\">rawIDToken</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk15\">if</span><span class=\"mtk1\"> </span><span class=\"mtk12\">err</span><span class=\"mtk1\">!= </span><span class=\"mtk12\">nil</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk12\">log</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Printf</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Error verifying ID token: %v&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">err</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk15\">return</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">// Extract claims from the verified ID token.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">claims</span><span class=\"mtk1\"> interface{}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk15\">if</span><span class=\"mtk1\"> err := </span><span class=\"mtk12\">idToken</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Claims</span><span class=\"mtk1\">(&</span><span class=\"mtk12\">claims</span><span class=\"mtk1\">); </span><span class=\"mtk12\">err</span><span class=\"mtk1\">!= </span><span class=\"mtk12\">nil</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk12\">log</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Printf</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Error extracting claims: %v&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">err</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk15\">return</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">// Respond with a success message.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk12\">ctx</span><span class=\"mtk1\">.</span><span class=\"mtk11\">JSON</span><span class=\"mtk1\">(</span><span class=\"mtk12\">http</span><span class=\"mtk1\">.</span><span class=\"mtk12\">StatusOK</span><span class=\"mtk1\">, </span><span class=\"mtk12\">gin</span><span class=\"mtk1\">.</span><span class=\"mtk12\">H</span><span class=\"mtk1\">{</span><span class=\"mtk8\">&quot;message&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;success&quot;</span><span class=\"mtk1\">})</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// InjectRoutes sets up the routes for the application, including login and callback endpoints.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">func</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">srv</span><span class=\"mtk1\"> *</span><span class=\"mtk10\">Server</span><span class=\"mtk1\">) </span><span class=\"mtk11\">InjectRoutes</span><span class=\"mtk1\">() *</span><span class=\"mtk12\">gin</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Engine</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\trouter := </span><span class=\"mtk12\">gin</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Default</span><span class=\"mtk1\">()</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\tapi := </span><span class=\"mtk12\">router</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Group</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk3\">// Define the login route that redirects users to the OIDC provider for authentication.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk12\">api</span><span class=\"mtk1\">.</span><span class=\"mtk11\">GET</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/login&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">StartLoginProcess</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk3\">// Define the callback route that handles the callback from the OIDC provider.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk12\">api</span><span class=\"mtk1\">.</span><span class=\"mtk11\">GET</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/callback&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">HandleCallback</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">router</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">func</span><span class=\"mtk1\"> </span><span class=\"mtk11\">main</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">// Initialize the OAuth2 configuration and OIDC provider.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk11\">InitializeOAuthConfig</span><span class=\"mtk1\">()</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">// Create a new server instance.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\tserver := &</span><span class=\"mtk10\">Server</span><span class=\"mtk1\">{}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">// Inject routes into the Gin engine.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\trouter := </span><span class=\"mtk12\">server</span><span class=\"mtk1\">.</span><span class=\"mtk11\">InjectRoutes</span><span class=\"mtk1\">()</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">// Start the HTTP server.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk12\">log</span><span class=\"mtk1\">.</span><span class=\"mtk11\">Fatal</span><span class=\"mtk1\">(</span><span class=\"mtk12\">http</span><span class=\"mtk1\">.</span><span class=\"mtk11\">ListenAndServe</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;:8080&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">router</span><span class=\"mtk1\">))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>The process described involves several key steps in setting up an OAuth2 flow with OpenID Connect (OIDC) for user authentication.</p>\n<p>Here's a brief overview of what was done in the code:</p>\n<h3 id=\"initialization-of-oidc-provider-and-oauth2-configuration\" style=\"position:relative;\"><a href=\"#initialization-of-oidc-provider-and-oauth2-configuration\" aria-label=\"initialization of oidc provider and oauth2 configuration permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Initialization of OIDC Provider and OAuth2 Configuration</h3>\n<ul>\n<li>The OIDC provider is initialized using the <code>oidc.NewProvider</code> function, which requires the OAuth2 endpoint and the OIDC provider's URL. This step is crucial for establishing a connection with the OIDC provider, enabling the application to authenticate users through the provider.</li>\n<li>The OAuth2 configuration (<code>oauthConfig</code>) is set up with essential details such as the client ID, client secret, redirect URL, and scopes. These credentials are specific to the OIDC application registered with the provider (e.g., LoginRadius). The redirect URL is where the provider will send the user after authentication, and the scopes define the permissions requested from the user.</li>\n</ul>\n<h3 id=\"setting-up-the-callback-endpoint\" style=\"position:relative;\"><a href=\"#setting-up-the-callback-endpoint\" aria-label=\"setting up the callback endpoint permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Setting Up the Callback Endpoint</h3>\n<ul>\n<li>A callback endpoint is defined in the application, typically as <code>/api/callback</code>. This endpoint handles the callback from the OIDC provider after the user has been authenticated.</li>\n<li>When the user authenticates successfully, the OIDC provider redirects the user back to the application with an authorization code included in the query parameters.</li>\n<li>The application then exchanges this authorization code for an access token by calling the exchange method on the OAuth2 configuration object. This exchange process is handled securely by the OAuth2 library, ensuring that the application receives a valid access token.</li>\n</ul>\n<h3 id=\"verifying-the-access-token-and-extracting-user-claims\" style=\"position:relative;\"><a href=\"#verifying-the-access-token-and-extracting-user-claims\" aria-label=\"verifying the access token and extracting user claims permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Verifying the Access Token and Extracting User Claims</h3>\n<ul>\n<li>Once the access token is obtained, the application extracts the ID token from it. The ID token contains claims about the authenticated user, such as their name, email, and roles.</li>\n<li>The ID token is then verified using the OIDC provider's verifier. This step ensures that the token is valid and has not been tampered with. Verification involves checking the token's signature and possibly other claims to ensure it matches the expected values.</li>\n<li>After verification, the application extracts the claims from the ID token. These claims can be used to identify the user within the application, personalize the user experience, or enforce access control based on the user's roles or permissions.</li>\n</ul>\n<p>This process leverages the security and standardization provided by OIDC and OAuth2 to implement a secure authentication flow. By following these steps, the application can authenticate users through LoginRadius OIDC provider, ensuring that user credentials are managed securely and that the application can trust authenticated users' identities.</p>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>In this tutorial, you have learned how to implement OIDC SSO with LoginRadius as the Identity Provider. You have also built a simple Golang backend with Gin to understand the implementation.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n</style>","frontmatter":{"date":"May 30, 2024","updated_date":null,"title":"How to Implement OpenID Connect (OIDC) SSO with LoginRadius?","tags":["SSO","OIDC","LoginRadius"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/185a654052323b1a8fd3b9ee7f274ad3/58556/implementing-oidc-sso.webp","srcSet":"/static/185a654052323b1a8fd3b9ee7f274ad3/61e93/implementing-oidc-sso.webp 200w,\n/static/185a654052323b1a8fd3b9ee7f274ad3/1f5c5/implementing-oidc-sso.webp 400w,\n/static/185a654052323b1a8fd3b9ee7f274ad3/58556/implementing-oidc-sso.webp 800w,\n/static/185a654052323b1a8fd3b9ee7f274ad3/99238/implementing-oidc-sso.webp 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Sanjay Velu","github":"SanjayV0","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/bruteforce-lock-and-unlock/"},"html":"<p>First, let's understand some basic terminology.</p>\n<h2 id=\"basic-terminology\" style=\"position:relative;\"><a href=\"#basic-terminology\" aria-label=\"basic terminology permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Basic Terminology</h2>\n<ol>\n<li><strong>Brute-force attack:</strong> A method where every possible combination of characters or values is systematically tried to gain unauthorized access to a system, application, or data.</li>\n<li><strong>Brute-force lock:</strong> Brute-force lock is a type of account lock made to prevent a bruteforce attack.</li>\n<li><strong>Brute-force lockout:</strong> Brute-force lockout is a security mechanism that blocks access after a certain number of failed authentication attempts to prevent unauthorized access through repeated trial and error.</li>\n<li><strong>CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart):</strong> CAPTCHA is a method used to determine whether a user is human by presenting a challenge that is easy for humans to solve but difficult for bots.</li>\n<li><strong>Multi-Factor Authentication (MFA):</strong> MFA is a security method that requires multiple forms of identification to grant access, typically combining something the user knows, has, and is.</li>\n</ol>\n<p>In LoginRadius, you can implement brute-force lockout using APIs.</p>\n<blockquote>\n<p>To implement brute-force lockout, please register in the <a href=\"https://admin-console.loginradius.com/dashboard\"><em>LoginRadius Admin Console</em></a>.</p>\n</blockquote>\n<p>Let's go through the API implementation of brute-force lockout and user unlock.</p>\n<h2 id=\"api-implementation-for-brute-force-lockout\" style=\"position:relative;\"><a href=\"#api-implementation-for-brute-force-lockout\" aria-label=\"api implementation for brute force lockout permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>API Implementation for Brute-force Lockout</h2>\n<h3 id=\"creating-a-basic-application\" style=\"position:relative;\"><a href=\"#creating-a-basic-application\" aria-label=\"creating a basic application permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Creating a Basic Application</h3>\n<ol>\n<li>To implement brute-force lockout using API, create a simple app with login and registration features.</li>\n<li>This can be done by using <em><a href=\"https://admin-console.loginradius.com/deployment/idx\">Admin Console</a></em>.</li>\n<li>Navigate through <em><a href=\"https://devadmin-console.lrinternal.com/deployment/idx\">Deployment > Identity Experience Framework</a></em>.</li>\n<li>You can design the required application using theme, customization, preview, and implement options.</li>\n<li>You can also customize the predefined templates if needed.</li>\n</ol>\n<blockquote>\n<p>You can view the created app using the link <em><a href=\"https://%60%3Capp-name%3E%60.hub.loginradius.com/auth.aspx\">https://<code>&#x3C;app-name></code>.hub.loginradius.com/auth.aspx</a></em> in the <em>implement</em> section of the <em>Identity Experience Framework</em> or from the preview section.</p>\n</blockquote>\n<h3 id=\"brute-force-lockout\" style=\"position:relative;\"><a href=\"#brute-force-lockout\" aria-label=\"brute force lockout permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Brute-force Lockout</h3>\n<h4 id=\"enabling\" style=\"position:relative;\"><a href=\"#enabling\" aria-label=\"enabling permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Enabling</h4>\n<p>In LoginRadius, the brute-force lockout feature can be enabled from the <em><a href=\"https://admin-console.loginradius.com/platform-security/account-protection/auth-security/brute-force-lockout\">Admin Console</a></em>.</p>\n<p><img src=\"/d4fefb72eed8a8c22337eb1a58634dfa/admin_bfl_page.webp\" alt=\"admin_bfl_page.webp\"></p>\n<h4 id=\"testing\" style=\"position:relative;\"><a href=\"#testing\" aria-label=\"testing permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Testing</h4>\n<ol>\n<li>Register with a new user and log in with the correct email and password. It is observed that the user is redirected to the profile page after authentication.</li>\n</ol>\n<p><img src=\"/74e2274825a55d924012bf48c28cdec8/loginpage_with_data.webp\" alt=\"loginpage_with_data.webp\">\n<br>\n<img src=\"/c6754bab6e942978fa8890e779759a9b/successful_login.webp\" alt=\"successful_login.webp\"></p>\n<ol start=\"2\">\n<li>Now, log out and try to log in with incorrect credentials.</li>\n<li>If the password is incorrect successively till the lockout threshold, the account gets locked. </li>\n<li>Therefore, brute-force lockout is achieved.</li>\n</ol>\n<p><img src=\"/aca756d4489465f26ff81bc09fe7672d/incorrect_pwd.webp\" alt=\"incorrect_pwd.webp\"></p>\n<blockquote>\n<p>In the <em><a href=\"https://admin-console.loginradius.com/platform-security/account-protection/auth-security/brute-force-lockout\">Admin Console</a></em>, you can set the <em>brute-force lockout threshold, lockout type, and suspend effective period</em>. </p>\n</blockquote>\n<h3 id=\"lockout-types-in-loginradius\" style=\"position:relative;\"><a href=\"#lockout-types-in-loginradius\" aria-label=\"lockout types in loginradius permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Lockout Types in LoginRadius</h3>\n<p>LoginRadius supports the following lockout types: </p>\n<ol>\n<li><strong>Suspend</strong>: Suspends further login attempts after multiple failed tries for a certain amount of time, deterring automated attacks and enhancing system security by limiting access from suspicious sources.</li>\n<li>\n<p><strong>CAPTCHA</strong>: </p>\n<ul>\n<li>A security measure used to unlock a locked account on entering valid credentials by presenting a challenge to solve. </li>\n<li>This challenge is often easy for humans to solve but difficult for the bots.</li>\n</ul>\n<blockquote>\n<p><em>Refer <a href=\"#captcha\">CAPTCHA</a> in miscellaneous section to learn more</em>.</p>\n</blockquote>\n</li>\n<li><strong>Security Questions</strong>: A personalized query set up by the user to verify identity to unlock a locked account with valid credentials.</li>\n<li><strong>Block</strong>: Restricts login attempts from a specific source (email ID or username) after multiple failed tries, enhancing security against unauthorized access.</li>\n</ol>\n<h3 id=\"unlocking-an-account-locked-through-brute-force-lockout\" style=\"position:relative;\"><a href=\"#unlocking-an-account-locked-through-brute-force-lockout\" aria-label=\"unlocking an account locked through brute force lockout permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Unlocking an Account Locked through Brute-force Lockout</h3>\n<p>You can unlock the locked user account in two ways, using:</p>\n<ol>\n<li>Account Update API from the LoginRadius Account API collection.</li>\n<li>Auth Unlock Account by Access Token from the LoginRadius Authentication API collection.</li>\n</ol>\n<blockquote>\n<p>For more understanding on <em>Auth Unlock Account</em>, refer <a href=\"https://www.loginradius.com/docs/api/v2/admin-console/platform-security/auth-security-configuration/\">Auth Security Configuration</a></p>\n</blockquote>\n<h4 id=\"account-update-api-from-the-loginradius-account-api-collection\" style=\"position:relative;\"><a href=\"#account-update-api-from-the-loginradius-account-api-collection\" aria-label=\"account update api from the loginradius account api collection permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Account Update API from the LoginRadius Account API Collection</h4>\n<p>Calling the Account Update API with the provided endpoint, using the given method, providing the <em>apisecret</em> and <em>apikey</em>, and formatting the given body will unlock the account.</p>\n<ol>\n<li>Endpoint: <code>https://api.loginradius.com/identity/v2/manage/account/{uid}</code></li>\n<li>Method: PUT</li>\n<li>Parameters: apisecret, apikey</li>\n<li>Body:</li>\n</ol>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">{</span>\n<span class=\"grvsc-line\">   ...</span>\n<span class=\"grvsc-line\">  &quot;FirstName&quot;: &quot;Test&quot;,</span>\n<span class=\"grvsc-line\">  &quot;MiddleName&quot;: null,</span>\n<span class=\"grvsc-line\">   ...</span>\n<span class=\"grvsc-line\">}</span></code></pre>\n<ol start=\"5\">\n<li>Response:</li>\n</ol>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">{</span>\n<span class=\"grvsc-line\">    ...</span>\n<span class=\"grvsc-line\">    &quot;LoginLockedType&quot;: &quot;None&quot;,</span>\n<span class=\"grvsc-line\">    &quot;Email&quot;: [</span>\n<span class=\"grvsc-line\">        {</span>\n<span class=\"grvsc-line\">            &quot;Type&quot;: &quot;Primary&quot;,</span>\n<span class=\"grvsc-line\">            &quot;Value&quot;: &quot;user1@yopmail.com&quot;</span>\n<span class=\"grvsc-line\">        }</span>\n<span class=\"grvsc-line\">    ],</span>\n<span class=\"grvsc-line\">    ...</span>\n<span class=\"grvsc-line\">}</span></code></pre>\n<br>\n<p><img src=\"/7388319d1164e569687328d8f65724ba/unlocked_account_update.webp\" alt=\"unlocked_account_update.webp\"></p>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<ul>\n<li>Unlocking user accounts previously locked due to brute force lockout using LoginRadius APIs demonstrates the platform's account management and security enhancement efficiency.</li>\n<li>Moving forward, leveraging LoginRadius's robust security features ensures uninterrupted user access while fortifying your system against unauthorized access attempts.</li>\n</ul>\n<h2 id=\"miscellaneous\" style=\"position:relative;\"><a href=\"#miscellaneous\" aria-label=\"miscellaneous permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Miscellaneous</h2>\n<h3 id=\"captcha\" style=\"position:relative;\"><a href=\"#captcha\" aria-label=\"captcha permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>CAPTCHA</h3>\n<p>LoginRadius supports the following types of CAPTCHAs: </p>\n<ul>\n<li>reCAPTCHA V2: Users solve challenges like clicking on images or entering text to prove they're human.</li>\n<li>reCAPTCHA V3: Operates in the background, assessing user behavior to assign a risk score without user interaction.</li>\n<li>hCAPTCHA: Like reCAPTCHA, it offers bot protection with a privacy focus.</li>\n<li>QQ Tencent CAPTCHA: A CAPTCHA service by Tencent commonly used in China to verify human users.</li>\n</ul>\n<h3 id=\"multi-factor-authentication-mfa\" style=\"position:relative;\"><a href=\"#multi-factor-authentication-mfa\" aria-label=\"multi factor authentication mfa permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Multi-Factor Authentication (MFA):</h3>\n<ul>\n<li><em>LoginRadius</em> offers multiple security features, including Multi-Factor Authentication. </li>\n<li>This feature can be enabled from the <em><a href=\"https://admin-console.loginradius.com/dashboard\">Admin Console</a></em> to add an additional layer of security.</li>\n<li>LoginRadius provides predefined MFA types, which can be enabled further.</li>\n</ul>\n<p><em>To understand more about LoginRadius APIs, refer to the <a href=\"https://www.loginradius.com/docs/api/v2/getting-started/introduction/\">API docs</a></em>.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","frontmatter":{"date":"May 29, 2024","updated_date":null,"title":"Testing Brute-force Lockout with LoginRadius","tags":["Brute-force","LoginRadius","Authentication"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/868ffd6ee6f1dcdc0618db2afa053099/58556/implementing-brute-force-lockout.webp","srcSet":"/static/868ffd6ee6f1dcdc0618db2afa053099/61e93/implementing-brute-force-lockout.webp 200w,\n/static/868ffd6ee6f1dcdc0618db2afa053099/1f5c5/implementing-brute-force-lockout.webp 400w,\n/static/868ffd6ee6f1dcdc0618db2afa053099/58556/implementing-brute-force-lockout.webp 800w,\n/static/868ffd6ee6f1dcdc0618db2afa053099/99238/implementing-brute-force-lockout.webp 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Gayathri Suresh","github":"gayathrisuresh150501","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/smart-cache-redis-cloud-aws-elasticache-for-redis/"},"html":"<p>LoginRadius is one of the leading and technologically advanced Customer Identity and Access Management (CIAM) solutions. Enterprise customers rely on our CIAM to manage end-user authentication and authorization. They typically serve hundreds of thousands to millions of end-users, making our CIAM a critical part of their IT infrastructure and value delivery.</p>\n<p>Our backend consists of multiple microservices handling various identity and access management functions and workflows through APIs. And we use MongoDB as persistent storage for configuration data. For faster access and availability of this data, we deployed Redis in-memory cache through Redis Enterprise Cloud.</p>\n<h2 id=\"challenges-with-cache-updates\" style=\"position:relative;\"><a href=\"#challenges-with-cache-updates\" aria-label=\"challenges with cache updates permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Challenges with Cache Updates</h2>\n<p>We had our configuration cache set up in Redis Cloud. And to reduce the Redis Cloud latency, we kept the configuration cache at the application level in memory — but we ran into problems.</p>\n<p>Generally, customers don’t update their configurations so frequently. But when a customer updates their configuration, it doesn’t propagate in the backend until the server memory cache is purged — sometimes even taking several hours.</p>\n<p><em>This is bad for business:</em> A customer updates configurations in response to a new requirement or rapidly changing business environment. If these changes take so much time for a digital identity process, it can affect end-users and, in turn, business outcomes. Simply imagine that a customer updated app configuration to accommodate a one-time flash sale, and end-users can’t place orders properly due to configuration update issues!</p>\n<p>So, we started evaluating various options to address these issues. We considered running multiple instances in the Redis Cloud and synchronizing them to minimize latency for all regions while ensuring customer configuration updates go live immediately. But this proved to be technically cumbersome and costly.</p>\n<p>We continued our research with various solutions and concluded that AWS ElastiCache for Redis best serves our needs.</p>\n<h2 id=\"migrating-to-aws-elasticache-for-redis\" style=\"position:relative;\"><a href=\"#migrating-to-aws-elasticache-for-redis\" aria-label=\"migrating to aws elasticache for redis permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Migrating to AWS ElastiCache for Redis</h2>\n<p>AWS provides ElastiCache for Redis as a Redis Cloud alternative with all necessary capabilities. Also, we were already using AWS Cloud for some of our IT infrastructure needs.\nSo, we can deploy ElastiCache alongside the same infrastructure to solve the latency issues.</p>\n<p>Accordingly, we have created ElastiCache instances in multiple AWS regions and set up the primary ElastiCache DB to quickly sync configuration updates in the secondary ElastiCache instances. Also, we deployed ElastiCache instances in multiple locations as needed.</p>\n<p>For migration, we updated the old Redis and ElastiCache primary instances simultaneously. Once we reached a sufficient confidence level with the new setup, we completely switched over to ElastiCache.</p>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>Our applications and cache are deployed in AWS, so our API response latency is no longer problematic. Ultimately, we can reduce application in memory cache updates to a few minutes or seconds as required.</p>\n<p>Now customers get updated configurations deployed rapidly, solving our primary challenge!</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"August 09, 2023","updated_date":null,"title":"Breaking Down the Decision: Why We Chose AWS ElastiCache Over Redis Cloud","tags":["Cache","AWS","Redis","LoginRadius"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/c24493552cd32d4940767196408ef18d/58556/migrating-to-aws-elasticache-for-redis.webp","srcSet":"/static/c24493552cd32d4940767196408ef18d/61e93/migrating-to-aws-elasticache-for-redis.webp 200w,\n/static/c24493552cd32d4940767196408ef18d/1f5c5/migrating-to-aws-elasticache-for-redis.webp 400w,\n/static/c24493552cd32d4940767196408ef18d/58556/migrating-to-aws-elasticache-for-redis.webp 800w,\n/static/c24493552cd32d4940767196408ef18d/99238/migrating-to-aws-elasticache-for-redis.webp 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Kundan Singh","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/growth/flexible-work-culture-game-changer-for-employees/"},"html":"<h2 id=\"introduction\" style=\"position:relative;\"><a href=\"#introduction\" aria-label=\"introduction permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Introduction</h2>\n<p>As an employee who has been part of the LoginRadius family for the past four years, I am thrilled to share how our flexible work culture has revolutionized our professional lives. </p>\n<p>In this blog, I want to provide insights into the transformative power of our flexible work model and highlight the incredible initiatives that LoginRadius has implemented to support our well-being. This include daily virtual zumba sessions, month end celebrations and team parties, to name a few. </p>\n<h2 id=\"the-rise-of-flexible-work-redefining-work-life-integration\" style=\"position:relative;\"><a href=\"#the-rise-of-flexible-work-redefining-work-life-integration\" aria-label=\"the rise of flexible work redefining work life integration permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>The Rise of Flexible Work: Redefining Work-Life Integration</h2>\n<p>Post COVID-19 pandemic, LoginRadius swiftly embraced a flexible work model, blending the best aspects of remote and in-office work. This innovative approach provides the flexibility to work both from the office and remotely.</p>\n<h2 id=\"strengthening-bonds-work-life-balance-and-collaboration-in-harmony\" style=\"position:relative;\"><a href=\"#strengthening-bonds-work-life-balance-and-collaboration-in-harmony\" aria-label=\"strengthening bonds work life balance and collaboration in harmony permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Strengthening Bonds: Work-Life Balance and Collaboration in Harmony</h2>\n<p>The flexible <a href=\"https://www.loginradius.com/blog/growth/loginradius-employee-perks/\">work culture at LoginRadius</a> has been a game-changer when it comes to achieving work-life balance. Having the option to work from the office for a portion of the week allows us to collaborate in person, engage in face-to-face meetings, and strengthen our connections with colleagues. </p>\n<p>On the other hand, the flexibility to work remotely provides us with the opportunity to manage personal commitments, minimize commuting time, spend time with loved ones and create a harmonious integration of work and personal life. </p>\n<p>The combination of in-office and remote work at LoginRadius has successfully fostered collaboration and connectivity among employees. When we gather in the office, we can engage in spontaneous discussions, brainstorming sessions, and effective collaboration that is sometimes challenging to replicate in a remote work setting.</p>\n<h2 id=\"daily-virtual-zumba-sessions-shake-sweat-and-smile\" style=\"position:relative;\"><a href=\"#daily-virtual-zumba-sessions-shake-sweat-and-smile\" aria-label=\"daily virtual zumba sessions shake sweat and smile permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Daily Virtual Zumba Sessions: Shake, Sweat, and Smile!</h2>\n<p><img src=\"/98cc8dd06145c067f98bbe82eca16307/zumba-sessions.webp\" alt=\"zumba-session\" title=\"image_tooltip\"></p>\n<p>In addition to providing flexibility and autonomy, LoginRadius has taken employee well-being to another level by organizing daily virtual Zumba sessions. These fitness sessions are a testament to the company's commitment to fostering a healthy and vibrant work environment. The virtual Zumba sessions offer a fun and energetic outlet for us to stay active, destress, and recharge our minds. It's an opportunity to connect with colleagues virtually, share positive energy, and build camaraderie.</p>\n<h2 id=\"loginradius-tt-league-smash-spin-and-connect\" style=\"position:relative;\"><a href=\"#loginradius-tt-league-smash-spin-and-connect\" aria-label=\"loginradius tt league smash spin and connect permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>LoginRadius TT League: Smash, Spin, and Connect!</h2>\n<p>LoginRadius TT League is an interdepartmental table tennis league that brings out the competitive spirit and camaraderie within our teams. It is a time for friendly matches, cheering each other on, and building connections beyond our usual work interactions. During the league, we gather to showcase our table tennis skills, engage in thrilling matches, and support each other with cheers and encouragement. This league adds an extra dose of fun and excitement to our work environment, and it is just another way LoginRadius nurtures a positive and engaging culture for its employees.</p>\n<h2 id=\"celebrate-you-lets-party\" style=\"position:relative;\"><a href=\"#celebrate-you-lets-party\" aria-label=\"celebrate you lets party permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Celebrate You: Let's Party!</h2>\n<p><img src=\"/fdaa5a15895006e00ca46a1faeb1b608/party-mode.webp\" alt=\"alt_text\" title=\"image_tooltip\"></p>\n<p>LoginRadius understands the importance of celebrating milestones, recognizing achievements, and fostering a sense of community among its employees. To honor our hard work and create memorable experiences, LoginRadius organizes Celebrate You: Month End celebrations. These celebrations encompass a range of activities, including team-building exercises, recognition ceremonies, and engaging games. It's a time to come together as a team, celebrate our collective achievements, and forge deeper connections.</p>\n<p>And the fun doesn't stop there! Our monthly team lunch parties add an extra sprinkle of joy to our work life. These gatherings are a time for us to come together, share a delicious meal, and enjoy informal conversations outside of work tasks. Whether we are enjoying a catered meal or ordering from our favorite local restaurants, these lunch parties create a warm and inclusive atmosphere where laughter and conversation flow freely.</p>\n<h2 id=\"in-conclusion\" style=\"position:relative;\"><a href=\"#in-conclusion\" aria-label=\"in conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>In Conclusion</h2>\n<p>LoginRadius' adoption of a flexible work culture has proven to be a game-changer. It aligns our professional and personal lives, nurtures our well-being, and strengthens our sense of community and connection.</p>\n<p>As an <a href=\"https://www.loginradius.com/careers/\">employee at LoginRadius</a>, I am grateful to be part of an organization that prioritizes the holistic development and happiness of its employees. The flexible work model, combined with these initiatives, exemplifies the company's commitment to fostering a positive and engaging work culture.</p>\n<p>Together, we are embracing the exciting future of flexible work at LoginRadius, where collaboration, well-being, and celebration go hand in hand.</p>\n<p><a href=\"https://www.loginradius.com/careers/\"><img src=\"/db67cf8ccbab4c6c31bf98536baf7d6a/cta.webp\" alt=\"CTA\"></a></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"July 13, 2023","updated_date":null,"title":"Flexible Work Culture: A Game-Changer for LoginRadius and its Employees","tags":["flexible work culture","work life balance","LoginRadius"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.3333333333333333,"src":"/static/527523993c6a0776c7fb2c1cafef05fd/7f8e9/flexible-work-culture.webp","srcSet":"/static/527523993c6a0776c7fb2c1cafef05fd/61e93/flexible-work-culture.webp 200w,\n/static/527523993c6a0776c7fb2c1cafef05fd/1f5c5/flexible-work-culture.webp 400w,\n/static/527523993c6a0776c7fb2c1cafef05fd/7f8e9/flexible-work-culture.webp 768w","sizes":"(max-width: 768px) 100vw, 768px"}}},"author":{"id":"Azharuddin Mohammad","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/why-we-rebuilt-loginradius-dot-net-core-apis-with-go/"},"html":"<h2 id=\"introduction\" style=\"position:relative;\"><a href=\"#introduction\" aria-label=\"introduction permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Introduction</h2>\n<p>Currently, the LoginRadius Identity Platform processes more than 100K requests per second. As our developer and enterprise customers grow, we should be able to scale our APIs to handle staggering loads of requests per second. It won’t be surprising if our APIs have to serve a million requests per second in the future.</p>\n<p>Generally, we add more instances, CPU, or memory for supporting high request volumes. However, it has been burdening our infrastructure budget and maintenance. </p>\n<p>So, we’re focused on reducing the cost of compute capacity by improving efficiency. In this engineering update, we share our experience with a highly effective, low-risk, large-scale performance and cost optimization with Go.</p>\n<p>LoginRadius production environment consists of 30+ microservices backed by a cloud-native infrastructure. Most of these services are written in .NET and Node.js. In Q1 2021, we explored the possibilities of improving the performance of our services and optimizing costs.</p>\n<h2 id=\"how-loginradius-has-been-handling-high-rps-throughput\" style=\"position:relative;\"><a href=\"#how-loginradius-has-been-handling-high-rps-throughput\" aria-label=\"how loginradius has been handling high rps throughput permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How LoginRadius Has Been Handling High RPS Throughput?</h2>\n<p>LoginRadius tech stack consists of 30+ microservices. We have different microservices for each business service like Authentication, Web SSO, Federated SSO, etc. </p>\n<ul>\n<li>We have developed application microservices in various languages per the prevailing microservice use case.</li>\n<li>We have deployed our application in a multi-cloud environment across AWS, Azure, and Google Cloud by leveraging multiple availability zones and regions.</li>\n</ul>\n<h3 id=\"1-architecture\" style=\"position:relative;\"><a href=\"#1-architecture\" aria-label=\"1 architecture permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1) Architecture</h3>\n<p><strong>Core Applications:</strong> Multiple microservices instances for Authentication, Account API, Analytics API, Risk-based Authentication, Backend Jobs, Integrations, and much more, </p>\n<p><strong>Data Storage:</strong> MongoDB, Elasticsearch, Redis, and PostgreSQL clusters are used to store a range of datasets for various applications and functionalities.</p>\n<p><strong>Queues:</strong> Amazon Kinesis Data Streams, Amazon Simple Notification Service (SNS), Amazon Simple Queue Service (SQS), and Azure Queue Storage. </p>\n<p><strong>Other Services:</strong> Services for rate-limiting, bcrypt clusters, feature flags, and more.</p>\n<p><strong>Routing:</strong> AWS load balancers (ALB, NLB, and ELB from AWS) and some nodes running NGINX as a proxy.</p>\n<h3 id=\"2-availability\" style=\"position:relative;\"><a href=\"#2-availability\" aria-label=\"2 availability permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2) Availability</h3>\n<p>We've been utilizing a multi-cloud and multi-region architecture for years based on our and our customers’ data and privacy compliance requirements. However, as our usage (and load) grew with maintenance costs, we relied more on AWS resources.</p>\n<ul>\n<li>We are using multiple regions and multiple availability zones as per region.</li>\n<li>We are using terraform scripts to provision new environments. This infrastructure automation allowed us to quickly scale from thousands of requests per second to hundreds of thousands of requests per second.  </li>\n</ul>\n<p>This is the basic architecture of the environment in the US:</p>\n<p><img src=\"/491e73fe4836ca5daa93f6aad47f3b4d/basic-architecture.webp\" alt=\"Basic Architecture - US\"></p>\n<p>Each request is processed as follows:</p>\n<p><img src=\"/fc6929115da8e289aaaaa4880d05fe5b/request-processing-flow.webp\" alt=\"Request Processing Flow\"></p>\n<p>The above diagram shows two cloud regions — US East and US West.</p>\n<p>When requests come:</p>\n<ul>\n<li>First, our infrastructure checks the primary region's health. If health is good, all requests are served by the primary US East region with three separate availability zones. </li>\n<li>If health checks fail for the primary region, the US West region serves all the requests with three separate availability zones.</li>\n</ul>\n<p><strong>So, how do we maintain high availability?</strong></p>\n<p>Every availability zone has operating instances of all services (including databases). If one availability zone is down, we still have two availability zones.</p>\n<h3 id=\"3-scaling\" style=\"position:relative;\"><a href=\"#3-scaling\" aria-label=\"3 scaling permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3) Scaling</h3>\n<p>We are using a two-pronged scaling approach as scaling based on resource utilization (CPU &#x26; Memory) alone is not practical.</p>\n<ol>\n<li>Traffic-based scaling</li>\n<li>Based on CPU &#x26; Memory utilization</li>\n</ol>\n<h4 id=\"why-scaling-was-challenging\" style=\"position:relative;\"><a href=\"#why-scaling-was-challenging\" aria-label=\"why scaling was challenging permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Why Scaling Was Challenging?</h4>\n<p>Once, our multi-tenant application received a sudden spike in API requests — from thousands of requests to millions. Usually, adding new infrastructure to the existing pool takes around 60 seconds. And application deployment and start-up time were about 90 seconds. Plus, considering other possible delays in scaling, we can lose about 5 minutes for scaling up.</p>\n<p>Further, adding the time to gather metrics and make the scaling decision, the total delay can be ~6 minutes. This process can impact all multi-tenant customers' critical applications because user authentication and authorization are essential.</p>\n<p>We keep <em>Scaling Buffers</em> to support this kind of scenario.</p>\n<blockquote>\n<p><strong>Scaling Buffers:</strong>  During the <em>Scale-up Time</em>, the <em>Scaling Buffer</em> is the service's highest predicted traffic spike. Depending on the scaling strategy, we store several types of the buffer.</p>\n</blockquote>\n<p>Usually, we set a one million requests concurrency buffer. And based on the traffic pattern, our scaling automation triggers the scaling.</p>\n<h2 id=\"why-our-platform-performance-was-good-but-not-great\" style=\"position:relative;\"><a href=\"#why-our-platform-performance-was-good-but-not-great\" aria-label=\"why our platform performance was good but not great permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Why Our Platform Performance Was Good, But Not Great?</h2>\n<p>Our Platform performance is good. We can quickly handle millions of requests, and our application platform was scalable but not great. Minding the kind of growth we’re expecting, we wanted to improve and prepare our platform for the future.</p>\n<h3 id=\"challenges-in-the-existing-platform\" style=\"position:relative;\"><a href=\"#challenges-in-the-existing-platform\" aria-label=\"challenges in the existing platform permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Challenges in the Existing Platform</h3>\n<h4 id=\"1-startup-time\" style=\"position:relative;\"><a href=\"#1-startup-time\" aria-label=\"1 startup time permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1) Startup Time</h4>\n<p>No. of requests can fluctuate within a few seconds if not minutes or hours, especially with specific events such as holiday shopping, promotional events, Black Friday, etc. So, in the event of traffic spikes, application startup time plays a significant role in scaling.</p>\n<p>Our application startup time was around 90 seconds, so whenever scaling was happening due to high traffic, scaling took more time. That's why we needed to improve the application startup time.</p>\n<h4 id=\"2-cost\" style=\"position:relative;\"><a href=\"#2-cost\" aria-label=\"2 cost permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2) Cost</h4>\n<p>We used hundreds of <em>AWS c5.2xlarge</em> instances in a production environment to handle daily traffic. During certain events such as holiday shopping and Black Friday, we doubled our infrastructure according to expected traffic with a 20~30% buffer. We kept a high buffer because scaling took time with the existing .NET Core services. As a result, infrastructure cost was burdening as we were inefficiently deploying cloud infrastructure.</p>\n<h4 id=\"3-lack-of-flexibility-and-customization\" style=\"position:relative;\"><a href=\"#3-lack-of-flexibility-and-customization\" aria-label=\"3 lack of flexibility and customization permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3) Lack of Flexibility and Customization</h4>\n<p>We designed our Identity Platform a few years ago. Since then, the technology landscape has dramatically improved and optimized in recent years. </p>\n<p>Also, current technology platforms available to build and support our product (Identity Platform) are limited. So, it is crucial to align functionality with proper technology capabilities.</p>\n<p>We were facing challenges in customization. It was inflexible and limiting to deliver the required outcomes in more complex situations and use cases.</p>\n<h2 id=\"the-road-to-lightning-performance-thanks-to-go\" style=\"position:relative;\"><a href=\"#the-road-to-lightning-performance-thanks-to-go\" aria-label=\"the road to lightning performance thanks to go permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>The Road to Lightning Performance, Thanks to Go</h2>\n<h3 id=\"why-go\" style=\"position:relative;\"><a href=\"#why-go\" aria-label=\"why go permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Why <em>Go</em>?</h3>\n<p>We did a lot of research to choose the appropriate programming language for our application. We needed a language that would be simple to understand and learn, easy to maintain, and has high concurrency. Our research ended with Go due to its amazing qualities.</p>\n<p>Let's take a closer look. <em>Why choose Go? What makes Go such an excellent development language? What distinguishes it from the competition?</em> </p>\n<p>Let's get to the bottom of this by looking at what makes Go special.</p>\n<h3 id=\"go--background\" style=\"position:relative;\"><a href=\"#go--background\" aria-label=\"go  background permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Go — Background</h3>\n<p>Go is an open-source programming language developed by Google's Rob Pike, Robert Griesemer, and Ken Thompson. It was initially released in 2009. It has several enhancements and additions based on the C syntax to properly control memory use, manage objects, and enable static or strict typing along with concurrency.</p>\n<h4 id=\"1-concurrency\" style=\"position:relative;\"><a href=\"#1-concurrency\" aria-label=\"1 concurrency permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1) Concurrency</h4>\n<p>Concurrent code can be executed in parallel by separate computer cores or in sequence. Most programming languages lack concurrent execution when working with multiple threads. They often slow down programming, compiling, and execution.</p>\n<p>Go works with goroutines that are lightweight, low-cost threads. And Go channels allow goroutines to communicate with one another. </p>\n<p>Sequential Processes Communication: They are very similar to threads in Java but lightweight, and the cost of creating them is meager.</p>\n<h4 id=\"2-performance\" style=\"position:relative;\"><a href=\"#2-performance\" aria-label=\"2 performance permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2) Performance</h4>\n<p>Go's core value is simplicity: it builds quickly, runs quickly, and is simple to learn. To help speed things up, there are no classes or type inheritance. This makes it easier to build a market-ready product quickly. Furthermore, its simplicity allows for quick and simple maintenance.</p>\n<h4 id=\"3-standard-library\" style=\"position:relative;\"><a href=\"#3-standard-library\" aria-label=\"3 standard library permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3) Standard Library</h4>\n<p>Go has an excellent standard library that includes a large number of built-in essential type functions and packages that are both practical and straightforward to use: I/O, encoding and decoding, manipulating raw bytes, network utility functions, parsing, debugging, and a lot more are all made simple by particular packages. Testing support is also included in the standard library, so no other dependencies are required.</p>\n<h4 id=\"4-easy-to-learn\" style=\"position:relative;\"><a href=\"#4-easy-to-learn\" aria-label=\"4 easy to learn permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>4) Easy to Learn</h4>\n<p>Go has a simpler syntax than other languages and is simple to learn. The syntax of Go is somewhat similar to the C language. Developers can begin with Go in a couple of hours, but they need to spend time understanding best coding practices, especially understanding goroutines for concurrency.</p>\n<h2 id=\"benchmarking-api-performance-gains\" style=\"position:relative;\"><a href=\"#benchmarking-api-performance-gains\" aria-label=\"benchmarking api performance gains permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Benchmarking API Performance Gains</h2>\n<p>We run benchmarks on our API so that the performance insights help us make decisions about the tech stack. It will paint a clearer picture of where we stand compared to our existing tech stack and what areas need improvement or immediate attention. </p>\n<p>We did multiple stress tests on our high usage APIs built separately with .NET Core(Old) and Go (new). </p>\n<p>We are using Kubernetes to deploy and manage our microservices and application infrastructure and deploy our application microservices across multiple Pods.</p>\n<h3 id=\"stress-test-scenario\" style=\"position:relative;\"><a href=\"#stress-test-scenario\" aria-label=\"stress test scenario permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Stress Test Scenario</h3>\n<table>\n<thead>\n<tr>\n<th>Test Item</th>\n<th>Value</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Instance Type</td>\n<td>c5.2xlarge on AWS</td>\n</tr>\n<tr>\n<td>No. of Instances</td>\n<td>20</td>\n</tr>\n<tr>\n<td>Reverse Proxy</td>\n<td>NGINX</td>\n</tr>\n<tr>\n<td>Concurrent Requests</td>\n<td>20K per second</td>\n</tr>\n<tr>\n<td>Duration</td>\n<td>5 minutes</td>\n</tr>\n<tr>\n<td>Stress Test Tool</td>\n<td><a href=\"https://gatling.io/\">Gatling</a></td>\n</tr>\n</tbody>\n</table>\n<p>We deployed both applications in the same infrastructure and did the same stress test.\nGolang application has performed much better.</p>\n<h4 id=\"existing-application-matrix--net-core\" style=\"position:relative;\"><a href=\"#existing-application-matrix--net-core\" aria-label=\"existing application matrix  net core permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Existing Application Matrix — .NET Core</h4>\n<figure align=\"center\">\n  <img src=\"/425ce0aea8c01e3281101dd268d0def6/requests-and-responses-per-second-dot-net-core.webp\" alt=\"Requests and Responses per Second (.NET Core)\">\n  <figcaption> Graph - 1(a): Requests and Responses per Second (.NET Core)</figcaption>\n</figure>\n \n<figure align=\"center\">\n  <img src=\"/d7b965865c218de9b3e71b6559787500/response-time-percentiles-dot-net-core.webp\" alt=\"API Response Time (.NET Core)\">\n  <figcaption> Graph -1(b): API Response Time (.NET Core)</figcaption>\n</figure>\n<figure align=\"center\">\n  <img src=\"/cd1c01d04ed3965ac3ca5bfce7ba66dc/overall-matrix-dot-net-core.webp\" alt=\"Overall Matrix (.NET Core)\">\n  <figcaption> Graph - 1(c): Overall Matrix (.NET Core)</figcaption>\n</figure>\n<p>You can see some errors in Graph - 1(a) after ramping up to 15K users. Also, response time is increasing, as seen in Graph - 1(b).</p>\n<p>The application can recover after a couple of seconds, and after that, the application cannot respond. Application scaling is taking time. And existing infra cannot handle this spike, so the application crashes after 18K RPS.</p>\n<h4 id=\"new-application-matrix--go\" style=\"position:relative;\"><a href=\"#new-application-matrix--go\" aria-label=\"new application matrix  go permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>New Application Matrix — Go</h4>\n<p>We did the same stress test with the new Go application. It is easily able to handle this kind of concurrency without any issue. </p>\n<figure align=\"center\">\n  <img src=\"/64fd50adc421658ca67fbf096038dc9e/requests-and-responses-per-second-go-lang.webp\" alt=\"Requests and Responses per Second (Go)\">\n  <figcaption> Graph - 2(a): Requests and Responses per Second (Go)</figcaption>\n</figure>\n \n<figure align=\"center\">\n  <img src=\"/dd50184c7b2f042915816c6374a53590/response-time-percentiles-go-lang.webp\" alt=\"API Response Time (Go)\">\n  <figcaption> Graph -2(b): API Response Time (Go)</figcaption>\n</figure>\n<figure align=\"center\">\n  <img src=\"/19f6d7a35332ce026578459805a2327d/overall-matrix-go-lang.webp\" alt=\"Overall Matrix (Go)\">\n  <figcaption> Graph - 2(c): Overall Matrix (Go)</figcaption>\n</figure>\n<p>The Go application can easily handle 20K ramp-up requests per second without any issue, as shown in Graph -2(a).</p>\n<p>You can see in Graph - 2(b) what the response time was after 2 min 47 sec for a couple of seconds. The Go application was scaling during that time. It is scaling quickly, so it is not impacting API request performance, and, also, the application can recover response API time as expected. </p>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>In this article, you have learned how we have achieved better API performance by rebuilding them in Go, which were previously built in .NET Core. And you have understood our approach to this transition and how it increased the API performance of the LoginRadius Identity Platform.</p>\n<p>Leverage LoginRadius Identity Platform to build authentication functionality for your web and mobile apps. <a href=\"https://accounts.loginradius.com/auth.aspx?action=register\">Sign up for a free LoginRadius account here</a></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"June 06, 2022","updated_date":null,"title":"Why We Re-engineered LoginRadius APIs with Go?","tags":["Go","API",".NET","LoginRadius"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/da26686e342d94b3007681cd0379367c/58556/high-performance-identity-apis.webp","srcSet":"/static/da26686e342d94b3007681cd0379367c/61e93/high-performance-identity-apis.webp 200w,\n/static/da26686e342d94b3007681cd0379367c/1f5c5/high-performance-identity-apis.webp 400w,\n/static/da26686e342d94b3007681cd0379367c/58556/high-performance-identity-apis.webp 800w,\n/static/da26686e342d94b3007681cd0379367c/99238/high-performance-identity-apis.webp 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Vijay Singh Shekhawat","github":"code-vj","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/integrate-invisible-captcha-for-bot-protection/"},"html":"<p>Finding it challenging to integrate invisible reCAPTCHA only on specific web pages? This short tutorial helps you implement invisible reCAPTCHA at specific and distinct containers, such as login and forgot password. This tutorial uses LoginRadius to demonstrate this.</p>\n<blockquote>\n<p>You can <a href=\"https://accounts.loginradius.com/auth.aspx?plan=developer&#x26;action=register\">quickly create a free LoginRadius account here</a>.</p>\n</blockquote>\n<h2 id=\"what-is-recaptcha\" style=\"position:relative;\"><a href=\"#what-is-recaptcha\" aria-label=\"what is recaptcha permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is reCAPTCHA?</h2>\n<p><a href=\"https://www.google.com/recaptcha/about/\">Google reCAPTCHA</a> is a security service that helps protect your websites from fraud and abuse.</p>\n<p>Currently, LoginRadius supports two different versions of <strong>Google v2reCAPTCHA</strong>.</p>\n<ul>\n<li><strong>Checkbox</strong>: In this version of v2reCaptcha, the \"I'm not a robot\" checkbox requires a user to click it to verify the user is not a robot.</li>\n<li><strong>Invisible reCAPTCHA</strong>: This version of v2reCaptcha provides a better user experience by tracking mouse movements to identify if a human is interacting with the website.</li>\n</ul>\n<h2 id=\"the-scenario\" style=\"position:relative;\"><a href=\"#the-scenario\" aria-label=\"the scenario permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>The Scenario</h2>\n<p>You want to enable invisible reCAPTCHA on a specific page — a login page, for demonstration. To achieve this, first <a href=\"https://dashboard.loginradius.com/login\">login to your LoginRadius dashboard</a>. Or, <a href=\"https://accounts.loginradius.com/auth.aspx?action=register\">sign up here for a free account or 21-day free trial for the Developer Pro plan</a>.</p>\n<p>If you're new to LoginRadius, <a href=\"https://www.loginradius.com/resource/loginradius-ciam-developers-whitepaper\">follow our Getting Started documentation</a>docs/references/javascript-library/getting-started/) to get going. </p>\n<h3 id=\"solution-steps\" style=\"position:relative;\"><a href=\"#solution-steps\" aria-label=\"solution steps permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Solution Steps</h3>\n<ul>\n<li>First, you need to <a href=\"https://www.loginradius.com/resource/loginradius-ciam-developers-whitepaper\">enable reCAPTCHA (Invisible reCAPTCHA) from the LoginRadius dashboard</a>docs/guide/captcha/#step-2-captcha-deployment).</li>\n<li>When you enable the invisible reCAPTCHA from the Loginradius dashboard, it will also enable the reCAPTCHA at the registration page.</li>\n<li>Now, you want to only enable invisible reCAPTCHA for enabling bot protection only on the login page.</li>\n<li>\n<p>So, you will need to do the following client-side setup for adding the invisible reCAPTCHA on a specific page only — for example, on the login page.</p>\n<ul>\n<li>Disable the reCAPTCHA using the following code before initializing the LoginRadius Object.\n<code>raasoption.invisibleRecaptcha = false;</code></li>\n<li>\n<p>Now, add the following code to render the captcha only at the login page, and here <code>beforeFormRender</code> hook is used.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">LRObject.$hooks.register(&#39;beforeFormRender&#39;, function(name, schema){</span>\n<span class=\"grvsc-line\">LRObject.options.invisibleRecaptcha = false;</span>\n<span class=\"grvsc-line\">if (name == &#39;login&#39; ) {</span>\n<span class=\"grvsc-line\">  LRObject.options.invisibleRecaptcha = true;</span>\n<span class=\"grvsc-line\">   LRObject.util.addRecaptchaJS();</span>\n<span class=\"grvsc-line\">   LRObject.util.captchaSchema(&quot;loginradius-recaptcha_widget_login&quot;, schema);</span>\n<span class=\"grvsc-line\">}</span>\n<span class=\"grvsc-line\">});</span></code></pre>\n</li>\n</ul>\n</li>\n</ul>\n<p>The above code used the utility method <code>addRecaptchaJS</code> that adds the required JS for invisible reCAPTCHA. It also used the <code>captchaSchema</code> method to add reCAPTCHA within the Login Schema.</p>\n<ul>\n<li>\n<p>The last step is to stop resetting the reCAPTCHA before reCAPTCHA submission. So, add the following code:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">LRObject.$hooks.register(&#39;eventCalls&#39;, function(name){</span>\n<span class=\"grvsc-line\">LRObject.options.invisibleRecaptcha = false;</span>\n<span class=\"grvsc-line\">LRObject.options.optionalRecaptchaConfiguration.IsEnabled = true;</span>\n<span class=\"grvsc-line\">if (name == &#39;login&#39; ) {</span>\n<span class=\"grvsc-line\">  LRObject.options.invisibleRecaptcha = true;</span>\n<span class=\"grvsc-line\">  LRObject.options.optionalRecaptchaConfiguration.IsEnabled = false;</span>\n<span class=\"grvsc-line\">}</span>\n<span class=\"grvsc-line\">});</span></code></pre>\n</li>\n</ul>\n<p>When you check your hosted page, invisible reCAPTCHA will appear only on the login page.</p>\n<p>Similarly, you can follow the above steps to enable invisible reCAPTCHA on the registration(signup) page or any other page.</p>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>You have learned how to use invisible reCAPTCHA on specific web pages and forms with LoginRadius to improve user experience and prevent malicious bot traffic from being effective.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","frontmatter":{"date":"April 08, 2022","updated_date":null,"title":"How to Integrate Invisible reCAPTCHA for Bot Protection","tags":["reCAPTCHA","LoginRadius"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/f8a146c57decdef4899cbaa4abd69ba6/58556/configure-invisible-reCAPTCHA.webp","srcSet":"/static/f8a146c57decdef4899cbaa4abd69ba6/61e93/configure-invisible-reCAPTCHA.webp 200w,\n/static/f8a146c57decdef4899cbaa4abd69ba6/1f5c5/configure-invisible-reCAPTCHA.webp 400w,\n/static/f8a146c57decdef4899cbaa4abd69ba6/58556/configure-invisible-reCAPTCHA.webp 800w,\n/static/f8a146c57decdef4899cbaa4abd69ba6/99238/configure-invisible-reCAPTCHA.webp 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Versha Gupta","github":"vershagupta","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/guest-post/authenticating-svelte-apps/"},"html":"<p>In this tutorial, I’ll talk about adding authentication in a Svelte application using LoginRadius Authentication APIs. You'll understand step by step how to:</p>\n<ul>\n<li>create forms in Svelte;</li>\n<li>add reactivity to it;</li>\n<li>configure routing for our Svelte app; and,</li>\n<li>setup protected routes for authenticated users.</li>\n</ul>\n<p>You'll also learn how to consume REST APIs in a Svelte app using Fetch API and update user information in your Svelte store.</p>\n<h2 id=\"what-is-svelte\" style=\"position:relative;\"><a href=\"#what-is-svelte\" aria-label=\"what is svelte permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is Svelte?</h2>\n<p><a href=\"https://svelte.dev/\">Svelte</a> is a lightweight and minimal JavaScript compiler that ships a single JavaScript bundle to your application without any internal code of its own. This results in smaller bundle size and often a faster running application. It was also the <a href=\"https://insights.stackoverflow.com/survey/2021#section-most-loved-dreaded-and-wanted-web-frameworks\">most loved framework of 2021</a>.</p>\n<p>But what's the first feature you'd add in a Svelte application? Authentication! It's the gateway for your users to interact and use your website.</p>\n<p>So in this post, I’ll talk about how to add authentication in a Svelte application.</p>\n<h2 id=\"svelte-project-demo\" style=\"position:relative;\"><a href=\"#svelte-project-demo\" aria-label=\"svelte project demo permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Svelte Project Demo</h2>\n<p>You'll learn how to create forms in Svelte and add reactivity to it. You'll also understand how to conditionally render different UI components and set up protected routes for authenticated users in a Svelte application.</p>\n<p>To speed things up, you won't build your own authentication services from scratch. Instead, you'll use <a href=\"https://accounts.loginradius.com/auth.aspx?plan=developer&#x26;action=register\">LoginRadius</a> to quickly configure an authentication backend for your Svelte App.</p>\n<p>Here's a little demo of what your Svelte App would look like by the end of the tutorial:</p>\n<p><video controls width=\"700\" align=\"center\" src=\"/648a1d1a74555638a162015f5d7769b5/Svelte-Auth-LoginRadius-Demo.mp4\"/> </video></p>\n<p>Looks exciting? Let's jump right into it!</p>\n<h2 id=\"setup-a-svelte-app\" style=\"position:relative;\"><a href=\"#setup-a-svelte-app\" aria-label=\"setup a svelte app permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Setup a Svelte App</h2>\n<p>Let's start by creating a new Svelte project and adding some boilerplate code.</p>\n<h3 id=\"create-a-new-svelte-project\" style=\"position:relative;\"><a href=\"#create-a-new-svelte-project\" aria-label=\"create a new svelte project permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Create a New Svelte Project</h3>\n<p>Navigate into the directory of your choice and create a new Svelte project by running:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">npx degit sveltejs/template svelte-auth-app</span></code></pre>\n<p>That should create a new Svelte project with a simple starter template.</p>\n<p>Additionally, you'll need to install <a href=\"https://github.com/mefechoel/svelte-navigator\">svelte-navigator</a> package to set up routing in your Svelte app:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">npm i svelte-navigator</span></code></pre>\n<h3 id=\"configure-environment-variable-support\" style=\"position:relative;\"><a href=\"#configure-environment-variable-support\" aria-label=\"configure environment variable support permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Configure Environment Variable Support</h3>\n<p>You need to add environment variable support in your Svelte app to store and use your LoginRadius API Keys and Secrets.</p>\n<p>First, install a package called <a href=\"https://www.npmjs.com/package/dotenv\">dotenv</a> that let's create and use a special <code>.env</code> file to define your environment variables.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">npm i dotenv</span></code></pre>\n<p>Next, head over to the <code>rollup.config.js</code> file. Here, make some configurational changes on the <code>plugins</code> property, so your Svelte app can read those environment variables on the client-side:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">\t...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\tplugins: [</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk11\">replace</span><span class=\"mtk1\">({</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t\t</span><span class=\"mtk3\">// stringify the object</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t\t</span><span class=\"mtk12\">__myapp:</span><span class=\"mtk1\"> </span><span class=\"mtk10\">JSON</span><span class=\"mtk1\">.</span><span class=\"mtk11\">stringify</span><span class=\"mtk1\">({</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t\t  </span><span class=\"mtk12\">env:</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t\t\t</span><span class=\"mtk12\">isProd:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">production</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t\t\t...</span><span class=\"mtk11\">config</span><span class=\"mtk1\">().</span><span class=\"mtk12\">parsed</span><span class=\"mtk1\"> </span><span class=\"mtk3\">// attached the .env config</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t\t  }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t\t}),</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t  }),</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t],</span></span></code></pre>\n<p>You can refer to the complete <code>rollup.config.js</code> file for this project <a href=\"https://github.com/LoginRadius/engineering-blog-samples/blob/master/Svelte/SvelteAuthApp/rollup.config.js\">here</a>.</p>\n<h3 id=\"create-files-and-folders\" style=\"position:relative;\"><a href=\"#create-files-and-folders\" aria-label=\"create files and folders permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Create Files and Folders</h3>\n<p>Besides the initial set of files, your project will have the following directory structure:</p>\n<p><img src=\"/7ff6a22848efd6f0ca45f4ef24257176/Directory-Structure-Svelte-App.webp\" alt=\"Directory Structure Svelte App\"></p>\n<p>So go ahead and create those files and folders accordingly. I'll talk about each of these as you start filling them with some code.</p>\n<h3 id=\"add-project-styles\" style=\"position:relative;\"><a href=\"#add-project-styles\" aria-label=\"add project styles permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Add Project Styles</h3>\n<p>Your starter template should come with the following styles inside your <code>App.svelte file</code>:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"css\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk6\">main</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">text-align</span><span class=\"mtk1\">: </span><span class=\"mtk8\">center</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">padding</span><span class=\"mtk1\">: </span><span class=\"mtk7\">1em</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">max-width</span><span class=\"mtk1\">: </span><span class=\"mtk7\">240px</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">margin</span><span class=\"mtk1\">: </span><span class=\"mtk7\">0</span><span class=\"mtk1\"> </span><span class=\"mtk8\">auto</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk6\">h1</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">color</span><span class=\"mtk1\">: </span><span class=\"mtk8\">#ff3e00</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">text-transform</span><span class=\"mtk1\">: </span><span class=\"mtk8\">uppercase</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">font-size</span><span class=\"mtk1\">: </span><span class=\"mtk7\">4em</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">font-weight</span><span class=\"mtk1\">: </span><span class=\"mtk7\">100</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">@media</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">min-width</span><span class=\"mtk1\">: </span><span class=\"mtk7\">640px</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk6\">main</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">max-width</span><span class=\"mtk1\">: </span><span class=\"mtk8\">none</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>However, I have also added some additional styles inside the global stylesheet inside the <code>/public/build/global.css</code> file. You can copy those styles from <a href=\"https://github.com/LoginRadius/engineering-blog-samples/blob/master/Svelte/SvelteAuthApp/public/global.css\">here</a>.</p>\n<h2 id=\"global-data-store-for-authenticated-user\" style=\"position:relative;\"><a href=\"#global-data-store-for-authenticated-user\" aria-label=\"global data store for authenticated user permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Global Data Store for Authenticated User</h2>\n<p>Your Svelte app will store the authenticated user's data in a global data store to easily access and modify that data from any component within your application. Svelte provides you with the <code>writable</code> function inside the <code>svelte/store</code> dependency.</p>\n<p>Create a global object called <code>user</code> inside your <code>/src/stores.js</code> file:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">writable</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;svelte/store&quot;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">user</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">writable</span><span class=\"mtk1\">(</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">localStorage</span><span class=\"mtk1\">.</span><span class=\"mtk12\">user</span><span class=\"mtk1\"> ? </span><span class=\"mtk10\">JSON</span><span class=\"mtk1\">.</span><span class=\"mtk11\">parse</span><span class=\"mtk1\">(</span><span class=\"mtk12\">localStorage</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getItem</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;user&quot;</span><span class=\"mtk1\">)) : </span><span class=\"mtk4\">null</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">)</span></span></code></pre>\n<p>You have also synced the above <code>user</code> object with the browser's local storage so that this data persists on page reloads. If you're unfamiliar with what local storage is, <a href=\"https://www.loginradius.com/blog/engineering/guest-post/local-storage-vs-session-storage-vs-cookies/\">check out my guide on Local Storage vs. Session Storage vs. Cookies</a> that dives deeper into browser storage and other related concepts.</p>\n<h2 id=\"the-app-component-boilerplate\" style=\"position:relative;\"><a href=\"#the-app-component-boilerplate\" aria-label=\"the app component boilerplate permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>The App Component Boilerplate</h2>\n<p>The root component in your Svelte app is the App Component. This is located inside <code>/src/App.svelte</code>.</p>\n<p>It has the following imports declared inside:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  /** IMPORTS */ import Login from &#39;./Login.svelte&#39;; import Signup from</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  &#39;./Signup.svelte&#39;; import Home from &#39;./Home.svelte&#39;; import PrivateRoute from</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  &quot;./routes/PrivateRoutes.svelte&quot;; /** VARIABLES */ const sdkoptions = </span><span class=\"mtk4\">{}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>It also has an <code>sdkoptions</code> variable that will store the environment variables that you can easily pass to different components as and when they need it. You can get rid of any additional HTML inside the <code>App.svelte</code> file generated by the starter template.</p>\n<h2 id=\"the-login-component\" style=\"position:relative;\"><a href=\"#the-login-component\" aria-label=\"the login component permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>The Login Component</h2>\n<p>Let's head over to the <code>/src/Login.svelte</code> file to create the Login Page.</p>\n<h3 id=\"create-login-form\" style=\"position:relative;\"><a href=\"#create-login-form\" aria-label=\"create login form permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Create Login Form</h3>\n<p>Here's what the HTML of your Login Form consists of:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">h3</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Login</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">h3</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">form</span><span class=\"mtk1\"> </span><span class=\"mtk14\">on:submit|preventDefault=&quot;{handleSubmit}&quot;&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk14\">&lt;input</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;form-field&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">bind</span><span class=\"mtk1\">:</span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;{email}&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;email&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">placeholder</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;Email&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;form-field&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">bind</span><span class=\"mtk1\">:</span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;{password}&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;password&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">placeholder</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;Password&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">button</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;form-field&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    Login</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">button</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">&lt;/</span><span class=\"mtk12\">form</span><span class=\"mtk1\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">p</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  Don&#39;t have an account?</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">strong</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;link&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">on</span><span class=\"mtk1\">:</span><span class=\"mtk12\">click</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;{navigateToSignup}&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Sign up</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">strong</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">p</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>You have a login form with two input fields for email and password and a submit button. The form also has an <code>on:submit</code> handler with an event modifier to prevent the default reloading action of the form when it gets submitted.</p>\n<p>After the form, you have a simple link with an <code>on:click</code> handler that allows the user to navigate to the Signup page.</p>\n<h3 id=\"login-form-field-bindings-and-handlers\" style=\"position:relative;\"><a href=\"#login-form-field-bindings-and-handlers\" aria-label=\"login form field bindings and handlers permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Login Form Field Bindings and Handlers</h3>\n<p>Inside the script of your Login component, create two variables — <code>email</code> and <code>password</code> — to handle the bindings to the input fields. Also, make the <code>sdkoptions</code> variable exportable since you'll receive it as <code>props</code> from the App component.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"8\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">let email; let password; export let sdkoptions;</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>You also need to create a function called <code>handleSubmit</code> that is the <code>on:submit</code> handler for your Login form:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    const handleSubmit=(e)=&gt;</span><span class=\"mtk4\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">       </span><span class=\"mtk12\">let</span><span class=\"mtk1\"> </span><span class=\"mtk12\">loginFields</span><span class=\"mtk1\">={</span><span class=\"mtk12\">email</span><span class=\"mtk1\">,</span><span class=\"mtk12\">password</span><span class=\"mtk1\">};</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t   </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">loginFields</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    const navigateToSignup=()=&gt;</span><span class=\"mtk4\">{}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>At the moment, you're simply encapsulating the <code>email</code> and <code>password</code> bindings into a JavaScript object. Later, you'll send a request to your Login API here. You also have an empty <code>navigateToSignup</code> function that I'll come back to once you set up your routes.</p>\n<p>Let's render the Login component inside your <code>App.svelte</code> file:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">main</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Login</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">main</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p><img src=\"/7804c05118f523c534443446c37d8939/Login-Page.webp\" alt=\"Login Page\"></p>\n<p>Awesome! Let's follow the same process to create your Signup form.</p>\n<h2 id=\"the-signup-component\" style=\"position:relative;\"><a href=\"#the-signup-component\" aria-label=\"the signup component permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>The Signup Component</h2>\n<p>Head over to the <code>/src/Signup.svelte</code> file to create your Signup Page.</p>\n<h3 id=\"create-signup-form\" style=\"position:relative;\"><a href=\"#create-signup-form\" aria-label=\"create signup form permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Create Signup Form</h3>\n<p>Similar to the Login Form, the Signup Form will have the following HTML:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"11\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">h3</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Create a New Account</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">h3</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">form</span><span class=\"mtk1\"> </span><span class=\"mtk14\">on:submit|preventDefault=&quot;{handleSubmit}&quot;&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk14\">&lt;input</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;form-field&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">bind</span><span class=\"mtk1\">:</span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;{firstName}&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;text&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">placeholder</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;First Name&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;form-field&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">bind</span><span class=\"mtk1\">:</span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;{lastName}&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;text&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">placeholder</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;Last Name&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;form-field&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">bind</span><span class=\"mtk1\">:</span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;{email}&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;email&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">placeholder</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;Email&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;form-field&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">bind</span><span class=\"mtk1\">:</span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;{password}&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;password&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">placeholder</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;Password&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">button</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;form-field&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    Signup</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">button</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">&lt;/</span><span class=\"mtk12\">form</span><span class=\"mtk1\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">p</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  Already have an account?</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">strong</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;link&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">on</span><span class=\"mtk1\">:</span><span class=\"mtk12\">click</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;{navigateToLogin}&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Login</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">strong</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">p</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>The only difference is now you have two additional fields — first name and last name. You also have a link just below the signup form that takes the user to the login page.</p>\n<h3 id=\"signup-form-field-bindings-and-handlers\" style=\"position:relative;\"><a href=\"#signup-form-field-bindings-and-handlers\" aria-label=\"signup form field bindings and handlers permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Signup Form Field Bindings and Handlers</h3>\n<p>Here's what the script section of your <code>Signup.svelte</code> file should look like:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"12\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\tlet email;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    let password;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    let firstName;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    let lastName;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    let loading;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    export let sdkoptions;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    const handleSubmit=()=&gt;</span><span class=\"mtk4\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">signupFields</span><span class=\"mtk1\">={</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk8\">&quot;FirstName&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">firstName</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk8\">&quot;LastName&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">lastName</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk8\">&quot;Email&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> [</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk8\">&quot;Type&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Primary&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk8\">&quot;Value&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">email</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            ],</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk8\">&quot;Password&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">password</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">     }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">     </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">signupFields</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">   </span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">   const navigateToLogin=()=&gt;</span><span class=\"mtk4\">{}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>Your <code>signupFields</code> object has a specific format because it aligns with the structure of your Signup API's request. It would make complete sense when you hook your Signup API here.</p>\n<p>Let's render the Signup component inside your <code>App.svelte</code> file:</p>\n<p><img src=\"/a18f23d4ceb0fe893dd8d49789a5b911/Signup-Page.webp\" alt=\"Signup Page\"></p>\n<h2 id=\"the-home-component\" style=\"position:relative;\"><a href=\"#the-home-component\" aria-label=\"the home component permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>The Home Component</h2>\n<p>Let's create your Home component or the page where you'll redirect an user on a successfull login. Inside <code>/src/Home.svelte</code> file, add the following HTML:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"13\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">{#</span><span class=\"mtk15\">if</span><span class=\"mtk1\"> </span><span class=\"mtk12\">user</span><span class=\"mtk1\"> && </span><span class=\"mtk12\">_user</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">h3</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Welcome </span><span class=\"mtk4\">{</span><span class=\"mtk12\">_user</span><span class=\"mtk1\">?.</span><span class=\"mtk12\">profile</span><span class=\"mtk1\">?.</span><span class=\"mtk12\">FullName</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">h3</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">button</span><span class=\"mtk1\"> </span><span class=\"mtk12\">on</span><span class=\"mtk1\">:</span><span class=\"mtk12\">click</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;{logout}&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Logout</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">button</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{/</span><span class=\"mtk15\">if</span><span class=\"mtk1\">}</span></span></code></pre>\n<p>In the above HTML, you simply use some Svelte conditionals to render the user's name and a logout button. The script part of your Home component looks like this:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"14\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    import </span><span class=\"mtk4\">{</span><span class=\"mtk12\">user</span><span class=\"mtk4\">}</span><span class=\"mtk1\"> from &#39;./stores&#39;;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    let _user;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    user.subscribe(data=&gt;_user=data)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    const logout=()=&gt;</span><span class=\"mtk4\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">user</span><span class=\"mtk1\">.</span><span class=\"mtk11\">set</span><span class=\"mtk1\">(</span><span class=\"mtk4\">null</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">localStorage</span><span class=\"mtk1\">.</span><span class=\"mtk11\">clear</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>You import the global <code>user</code> object from your Svelte store and store it inside your Home component's state <code>_user</code>. For the <code>logout</code> function, you simply set this <code>user</code> object in your store to null and clear the local storage.</p>\n<h2 id=\"setup-loginradius\" style=\"position:relative;\"><a href=\"#setup-loginradius\" aria-label=\"setup loginradius permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Setup LoginRadius</h2>\n<p>The next step is to set up LoginRadius, so you can start using its Authentication APIs from your Svelte App.</p>\n<h3 id=\"create-loginradius-account\" style=\"position:relative;\"><a href=\"#create-loginradius-account\" aria-label=\"create loginradius account permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Create LoginRadius Account</h3>\n<p>Head over to <a href=\"https://accounts.loginradius.com/auth.aspx?plan=developer&#x26;action=register\">LoginRadius</a> and create a new account by filling in the following details:</p>\n<p><img src=\"/07e3f97860f329f52e8fd676c7ca73fb/Signup-2.webp\" alt=\"Signup 2\"></p>\n<p>You'll then see a form with the name of your App, a URL, and a Data Center:</p>\n<p><img src=\"/fdeb64de0e13dcf68954b8d6a8c801b5/Signup-3.webp\" alt=\"Signup 3\"></p>\n<p>Hit <strong>Next</strong> and LoginRadius will set up an authentication app for you. You can try the pre-built authentication page LoginRadius provides for your app by clicking on <strong>Try Signing Up Now</strong>.</p>\n<p><img src=\"/a7d6dc1dd6df5add1461011a1a270cb3/Signup-4.webp\" alt=\"Signup 4\"></p>\n<p>Once you do that, you'll be shown a pre-built authentication page of your LoginRadius app:</p>\n<p><img src=\"/54605addc29f464b1e42e5e254d71222/LoginRadius-Auth-Page.webp\" alt=\"LoginRadius Auth Page\"></p>\n<p>However, for this tutorial, all you need are the LoginRadius APIs since you already have a frontend (your Svelte App) in place.</p>\n<h3 id=\"get-loginradius-api-configurations\" style=\"position:relative;\"><a href=\"#get-loginradius-api-configurations\" aria-label=\"get loginradius api configurations permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Get LoginRadius API Configurations</h3>\n<p>Once you're inside your LoginRadius account, head over to the <strong>Configurations</strong> tab from your dashboard. Then expand the <strong>API Credentials</strong> tab of your application.</p>\n<p><img src=\"/33760eee3a762ea61cb29f2f95e3bdfe/LoginRadius-Configuration-Tab.webp\" alt=\"LoginRadius Configuration Tab\"></p>\n<p>Inside that, you should see your APP Name, API Key, and API Secret.</p>\n<p><img src=\"/9a345c5c29b7bf85649af7394a806147/LoginRadius-API-Credentials.webp\" alt=\"LoginRadius API Credentials\"></p>\n<h3 id=\"add-api-credentials-as-environment-variables\" style=\"position:relative;\"><a href=\"#add-api-credentials-as-environment-variables\" aria-label=\"add api credentials as environment variables permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Add API Credentials as Environment Variables</h3>\n<p>Head back to the Svelte App's <code>.env</code> file and add the above credentials inside it:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"15\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">APP_NAME=&lt;YOUR_APP_NAME&gt;</span>\n<span class=\"grvsc-line\">API_CLIENT_KEY= &lt;YOUR_APP_API_KEY&gt;</span>\n<span class=\"grvsc-line\">API_SECRET= &lt;YOUR_APP_API_SECRET&gt;</span></code></pre>\n<p>You'll need to ensure that the above <code>.env</code> file is present inside the <code>.gitignore</code> of your Svelte project. You don't want to accidentally push this file to a public repository on Github.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"16\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">/node_modules/</span>\n<span class=\"grvsc-line\">/public/build/</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">.DS_Store</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">.env</span></code></pre>\n<h3 id=\"consume-environment-variables-in-svelte-components\" style=\"position:relative;\"><a href=\"#consume-environment-variables-in-svelte-components\" aria-label=\"consume environment variables in svelte components permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Consume Environment Variables in Svelte Components</h3>\n<p>Finally, you need to extract these environment variables in your <code>sdkoptions</code> variables inside your App component file.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"17\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">sdkoptions</span><span class=\"mtk1\"> = {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk8\">&quot;apiKey&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">__myapp</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&quot;env&quot;</span><span class=\"mtk1\">].</span><span class=\"mtk12\">API_CLIENT_KEY</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk8\">&quot;appName&quot;</span><span class=\"mtk12\">:__myapp</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&quot;env&quot;</span><span class=\"mtk1\">].</span><span class=\"mtk12\">APP_NAME</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk8\">&quot;apiSecret&quot;</span><span class=\"mtk12\">:__myapp</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&quot;env&quot;</span><span class=\"mtk1\">].</span><span class=\"mtk12\">API_SECRET</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">...</span></span></code></pre>\n<p>And pass this variable as props to both the Login and Signup component:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"18\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Login</span><span class=\"mtk1\"> </span><span class=\"mtk4\">{</span><span class=\"mtk12\">sdkoptions</span><span class=\"mtk4\">}</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Signup</span><span class=\"mtk1\"> </span><span class=\"mtk4\">{</span><span class=\"mtk12\">sdkoptions</span><span class=\"mtk4\">}</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">...</span></span></code></pre>\n<p>Great! Now you're ready to integrate LoginRadius APIs in your Svelte app.</p>\n<h2 id=\"integrate-loginradius-api\" style=\"position:relative;\"><a href=\"#integrate-loginradius-api\" aria-label=\"integrate loginradius api permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Integrate LoginRadius API</h2>\n<p>You'll use two APIs — one for registering the user on the Signup page and the other for authenticating the user on the Login Page. However, both APIs will take the API key and API secret as query parameters.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"19\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">endpoint</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">`</span><span class=\"mtk4\">${</span><span class=\"mtk12\">BASE_URL</span><span class=\"mtk4\">}</span><span class=\"mtk8\">?apikey=</span><span class=\"mtk4\">${</span><span class=\"mtk12\">sdkoptions</span><span class=\"mtk1\">.</span><span class=\"mtk12\">apiKey</span><span class=\"mtk4\">}</span><span class=\"mtk8\">&apisecret=</span><span class=\"mtk4\">${</span><span class=\"mtk12\">sdkoptions</span><span class=\"mtk1\">.</span><span class=\"mtk12\">apiSecret</span><span class=\"mtk4\">}</span><span class=\"mtk8\">`</span></span></code></pre>\n<p>So in the above endpoint, you'll only change the <code>BASE_URL</code> according to which API you're hitting.</p>\n<h3 id=\"integrate-signup-api\" style=\"position:relative;\"><a href=\"#integrate-signup-api\" aria-label=\"integrate signup api permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Integrate Signup API</h3>\n<p>Inside your <code>Signup.svelte</code> file, you'll create a variable called <code>signupResponse</code> to store the result of the Signup API. It also has properties like <code>success</code> and <code>error</code> to prompt the user on the status of your API calls.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"20\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    let signupResponse=</span><span class=\"mtk4\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">success</span><span class=\"mtk1\">:</span><span class=\"mtk4\">null</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">error</span><span class=\"mtk1\">:</span><span class=\"mtk4\">null</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">uid</span><span class=\"mtk1\">:</span><span class=\"mtk4\">null</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">id</span><span class=\"mtk1\">:</span><span class=\"mtk4\">null</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">fullname</span><span class=\"mtk1\">:</span><span class=\"mtk4\">null</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">     </span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> \tlet loading;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>Since an API request is an asynchronous process, you also have a' loading' variable to disable the submit button until the API responds.</p>\n<h4 id=\"signup-api-request-on-signup-form-submission\" style=\"position:relative;\"><a href=\"#signup-api-request-on-signup-form-submission\" aria-label=\"signup api request on signup form submission permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Signup API Request on Signup Form Submission</h4>\n<p>You need to send a request to the Signup API inside your <code>handleSubmit()</code> function. First, set the <code>loading</code> to true and reset the <code>signupResponse</code> object. Then, use the fetch API to make a POST request with the <code>signupFields</code> object as post parameter:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"21\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">handleSubmit</span><span class=\"mtk1\"> = () </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">signupFields</span><span class=\"mtk1\"> = {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">FirstName:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">firstName</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">LastName:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">lastName</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">Email:</span><span class=\"mtk1\"> [</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">Type:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Primary&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">Value:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">email</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    ],</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">Password:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">password</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">loading</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">true</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">signupResponse</span><span class=\"mtk1\"> = {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">success:</span><span class=\"mtk1\"> </span><span class=\"mtk4\">null</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">error:</span><span class=\"mtk1\"> </span><span class=\"mtk4\">null</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">uid:</span><span class=\"mtk1\"> </span><span class=\"mtk4\">null</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">id:</span><span class=\"mtk1\"> </span><span class=\"mtk4\">null</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">fullname:</span><span class=\"mtk1\"> </span><span class=\"mtk4\">null</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">endpoint</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">`https://api.loginradius.com/identity/v2/manage/account?apikey=</span><span class=\"mtk4\">${</span><span class=\"mtk12\">sdkoptions</span><span class=\"mtk1\">.</span><span class=\"mtk12\">apiKey</span><span class=\"mtk4\">}</span><span class=\"mtk8\">&apisecret=</span><span class=\"mtk4\">${</span><span class=\"mtk12\">sdkoptions</span><span class=\"mtk1\">.</span><span class=\"mtk12\">apiSecret</span><span class=\"mtk4\">}</span><span class=\"mtk8\">`</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk11\">fetch</span><span class=\"mtk1\">(</span><span class=\"mtk12\">endpoint</span><span class=\"mtk1\">, {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">method:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;POST&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">headers:</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk8\">&quot;Content-Type&quot;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;application/json&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">body:</span><span class=\"mtk1\"> </span><span class=\"mtk10\">JSON</span><span class=\"mtk1\">.</span><span class=\"mtk11\">stringify</span><span class=\"mtk1\">(</span><span class=\"mtk12\">signupFields</span><span class=\"mtk1\">),</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  })</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    .</span><span class=\"mtk11\">then</span><span class=\"mtk1\">(</span><span class=\"mtk12\">response</span><span class=\"mtk1\"> </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk11\">json</span><span class=\"mtk1\">())</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    .</span><span class=\"mtk11\">then</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\"> </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {})</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    .</span><span class=\"mtk11\">catch</span><span class=\"mtk1\">(</span><span class=\"mtk12\">error</span><span class=\"mtk1\"> </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">error</span><span class=\"mtk1\">))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    .</span><span class=\"mtk11\">finally</span><span class=\"mtk1\">(() </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">loading</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">false</span><span class=\"mtk1\">))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<h4 id=\"handle-api-response\" style=\"position:relative;\"><a href=\"#handle-api-response\" aria-label=\"handle api response permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Handle API Response</h4>\n<p>Inside the callback of your fetch request, you can handle any errors returned by the API based on different error codes. In case of success, you'll populate your <code>signupResponse</code> object with data from the API. In the <code>finally</code> block, set the <code>loading</code> to false.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"22\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">.</span><span class=\"mtk11\">then</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          </span><span class=\"mtk15\">if</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">ErrorCode</span><span class=\"mtk1\">){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">              </span><span class=\"mtk15\">if</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">ErrorCode</span><span class=\"mtk1\">==</span><span class=\"mtk7\">936</span><span class=\"mtk1\">){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">              </span><span class=\"mtk12\">signupResponse</span><span class=\"mtk1\">={</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    ...</span><span class=\"mtk12\">signupResponse</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk12\">error:data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Message</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">             }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk15\">else</span><span class=\"mtk1\"> </span><span class=\"mtk15\">if</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">ErrorCode</span><span class=\"mtk1\">==</span><span class=\"mtk7\">1134</span><span class=\"mtk1\">){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">signupResponse</span><span class=\"mtk1\">={</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    ...</span><span class=\"mtk12\">signupResponse</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk12\">error:data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Errors</span><span class=\"mtk1\">[</span><span class=\"mtk7\">0</span><span class=\"mtk1\">].</span><span class=\"mtk12\">ErrorMessage</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }</span><span class=\"mtk15\">else</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">signupResponse</span><span class=\"mtk1\">={</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    ...</span><span class=\"mtk12\">signupResponse</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk12\">error:data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Description</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        }</span><span class=\"mtk15\">else</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">signupResponse</span><span class=\"mtk1\">={</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                ...</span><span class=\"mtk12\">signupResponse</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">success:</span><span class=\"mtk8\">&quot;Account created successfully! Please login via the same details.&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">fullname:data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">FullName</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">id:data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">id</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">uid:data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Uid</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      })</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">...</span></span></code></pre>\n<h4 id=\"disable-submit-button\" style=\"position:relative;\"><a href=\"#disable-submit-button\" aria-label=\"disable submit button permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Disable Submit Button</h4>\n<p>You can set the disabled attribute on your Submit button based on the loading state of the API.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"23\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">button</span><span class=\"mtk1\"> </span><span class=\"mtk12\">disabled</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;{loading}&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;form-field&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  Signup</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">button</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">...</span></span></code></pre>\n<h4 id=\"show-signup-success-and-error\" style=\"position:relative;\"><a href=\"#show-signup-success-and-error\" aria-label=\"show signup success and error permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Show Signup Success and Error</h4>\n<p>Lastly, render a conditional template based on the status of your Signup API.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"24\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">... {#</span><span class=\"mtk15\">if</span><span class=\"mtk1\"> </span><span class=\"mtk12\">signupResponse</span><span class=\"mtk1\">.</span><span class=\"mtk12\">error</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">p</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;error&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Error ❌ </span><span class=\"mtk4\">{</span><span class=\"mtk12\">signupResponse</span><span class=\"mtk1\">.</span><span class=\"mtk12\">error</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">p</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{/</span><span class=\"mtk15\">if</span><span class=\"mtk1\">} {#</span><span class=\"mtk15\">if</span><span class=\"mtk1\"> </span><span class=\"mtk12\">signupResponse</span><span class=\"mtk1\">.</span><span class=\"mtk12\">success</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">p</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;success&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  Success ✔ </span><span class=\"mtk4\">{</span><span class=\"mtk12\">signupResponse</span><span class=\"mtk1\">.</span><span class=\"mtk12\">success</span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">p</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{/</span><span class=\"mtk15\">if</span><span class=\"mtk1\">} ...</span></span></code></pre>\n<p>And that's it! Let's give your Signup functionality a whirl. Create a new account first:</p>\n<p><img src=\"/d6d0033b0fcf1b74c7ccf39658e1f036/Signup-Success-with-API.webp\" alt=\"Signup Success with API\"></p>\n<p>And voila! You can see in the network tab that the API is successful. And you got back a bunch of data about the newly created user. You also have a success that appears underneath the Signup form.</p>\n<p>Let's also test an erroneous flow. What if you signup via the same credentials again?</p>\n<p><img src=\"/6f7b551dfb5856a6f944dac271fc31fa/Signup-Failure-Existing-Email.webp\" alt=\"Signup Failure Existing Email\"></p>\n<p>The LoginRadius Signup API returns the error message, details, error code, etc., that you've handled accordingly.</p>\n<p>Also, if you use a simple password, the LoginRadius API returns an error based on a validation mechanism.</p>\n<p><img src=\"/40d4723bf56be75f912462de00e42e33/Signup-Error-Password-Validation.webp\" alt=\"Signup Error Password Validation\"></p>\n<p>That's great because it makes your authentication workflow more air-tight.</p>\n<h3 id=\"integrate-login-api\" style=\"position:relative;\"><a href=\"#integrate-login-api\" aria-label=\"integrate login api permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Integrate Login API</h3>\n<p>Similarly, you can now integrate the Login API as well in your <code>Login.svelte</code> file:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"25\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    import </span><span class=\"mtk4\">{</span><span class=\"mtk12\">user</span><span class=\"mtk4\">}</span><span class=\"mtk1\"> from &#39;./stores&#39;;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    let email;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    let password;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    let loading;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    let loginResponse=</span><span class=\"mtk4\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">error</span><span class=\"mtk1\">:</span><span class=\"mtk4\">null</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">success</span><span class=\"mtk1\">:</span><span class=\"mtk4\">null</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">profile</span><span class=\"mtk1\">:</span><span class=\"mtk4\">null</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">auth_token</span><span class=\"mtk1\">:</span><span class=\"mtk4\">null</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    export let sdkoptions;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    const handleSubmit=(e)=&gt;</span><span class=\"mtk4\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">       </span><span class=\"mtk12\">let</span><span class=\"mtk1\"> </span><span class=\"mtk12\">loginFields</span><span class=\"mtk1\">={</span><span class=\"mtk12\">email</span><span class=\"mtk1\">,</span><span class=\"mtk12\">password</span><span class=\"mtk1\">};</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">       </span><span class=\"mtk12\">loading</span><span class=\"mtk1\">=</span><span class=\"mtk4\">true</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">loginResponse</span><span class=\"mtk1\">={</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">error:</span><span class=\"mtk4\">null</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">success:</span><span class=\"mtk4\">null</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">profile:</span><span class=\"mtk4\">null</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">auth_token:</span><span class=\"mtk4\">null</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">       </span><span class=\"mtk12\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">endpoint</span><span class=\"mtk1\">=</span><span class=\"mtk8\">`https://api.loginradius.com/identity/v2/auth/login?apikey=</span><span class=\"mtk4\">${</span><span class=\"mtk12\">sdkoptions</span><span class=\"mtk1\">.</span><span class=\"mtk12\">apiKey</span><span class=\"mtk4\">}</span><span class=\"mtk8\">&apisecret=</span><span class=\"mtk4\">${</span><span class=\"mtk12\">sdkoptions</span><span class=\"mtk1\">.</span><span class=\"mtk12\">apiSecret</span><span class=\"mtk4\">}</span><span class=\"mtk8\">`</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">       </span><span class=\"mtk12\">loading</span><span class=\"mtk1\">=</span><span class=\"mtk4\">true</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk11\">fetch</span><span class=\"mtk1\">(</span><span class=\"mtk12\">endpoint</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">method:</span><span class=\"mtk8\">&#39;POST&#39;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">headers:</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk8\">&#39;Content-Type&#39;</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&#39;application/json&#39;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">body:</span><span class=\"mtk10\">JSON</span><span class=\"mtk1\">.</span><span class=\"mtk11\">stringify</span><span class=\"mtk1\">(</span><span class=\"mtk12\">loginFields</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        }).</span><span class=\"mtk11\">then</span><span class=\"mtk1\">(</span><span class=\"mtk12\">response</span><span class=\"mtk4\">=&gt;</span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk11\">json</span><span class=\"mtk1\">())</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        .</span><span class=\"mtk11\">then</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk15\">if</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">ErrorCode</span><span class=\"mtk1\">){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk15\">if</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">ErrorCode</span><span class=\"mtk1\">==</span><span class=\"mtk7\">936</span><span class=\"mtk1\">){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">loginResponse</span><span class=\"mtk1\">={</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                        ...</span><span class=\"mtk12\">loginResponse</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                        </span><span class=\"mtk12\">error:data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Message</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk15\">else</span><span class=\"mtk1\"> </span><span class=\"mtk15\">if</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">ErrorCode</span><span class=\"mtk1\">==</span><span class=\"mtk7\">1134</span><span class=\"mtk1\">){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk12\">loginResponse</span><span class=\"mtk1\">={</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                        ...</span><span class=\"mtk12\">loginResponse</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                        </span><span class=\"mtk12\">error:data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Errors</span><span class=\"mtk1\">[</span><span class=\"mtk7\">0</span><span class=\"mtk1\">].</span><span class=\"mtk12\">ErrorMessage</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                }</span><span class=\"mtk15\">else</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk12\">loginResponse</span><span class=\"mtk1\">={</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                        ...</span><span class=\"mtk12\">loginResponse</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                        </span><span class=\"mtk12\">error:data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Description</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }</span><span class=\"mtk15\">else</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">loginResponse</span><span class=\"mtk1\">={</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    ...</span><span class=\"mtk12\">loginResponse</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk12\">success:</span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk12\">profile:data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Profile</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk12\">auth_token:</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                        </span><span class=\"mtk12\">access_token:data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">access_token</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                        </span><span class=\"mtk12\">refresh_token:data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">refresh_token</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                        </span><span class=\"mtk12\">ttl:data</span><span class=\"mtk1\">.</span><span class=\"mtk12\">expires_in</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">user</span><span class=\"mtk1\">.</span><span class=\"mtk11\">set</span><span class=\"mtk1\">(</span><span class=\"mtk12\">loginResponse</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">localStorage</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setItem</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;user&#39;</span><span class=\"mtk1\">,</span><span class=\"mtk10\">JSON</span><span class=\"mtk1\">.</span><span class=\"mtk11\">stringify</span><span class=\"mtk1\">(</span><span class=\"mtk12\">loginResponse</span><span class=\"mtk1\">))</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        })</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        .</span><span class=\"mtk11\">catch</span><span class=\"mtk1\">(</span><span class=\"mtk12\">error</span><span class=\"mtk4\">=&gt;</span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">error</span><span class=\"mtk1\">))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        .</span><span class=\"mtk11\">finally</span><span class=\"mtk1\">(()</span><span class=\"mtk4\">=&gt;</span><span class=\"mtk12\">loading</span><span class=\"mtk1\">=</span><span class=\"mtk4\">false</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    ...</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{#</span><span class=\"mtk15\">if</span><span class=\"mtk1\"> </span><span class=\"mtk12\">loginResponse</span><span class=\"mtk1\">.</span><span class=\"mtk12\">error</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">p</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;error&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Error ❌ </span><span class=\"mtk4\">{</span><span class=\"mtk12\">loginResponse</span><span class=\"mtk1\">.</span><span class=\"mtk12\">error</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">p</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{/</span><span class=\"mtk15\">if</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{#</span><span class=\"mtk15\">if</span><span class=\"mtk1\"> </span><span class=\"mtk12\">loginResponse</span><span class=\"mtk1\">.</span><span class=\"mtk12\">success</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">p</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;success&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        Success ✔</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">p</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{/</span><span class=\"mtk15\">if</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">p</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    Don&#39;t have an account?</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">strong</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;link&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">on</span><span class=\"mtk1\">:</span><span class=\"mtk12\">click</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk12\">navigateToSignup</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Sign up</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">strong</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">p</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>If you relate it to the Signup component, it's almost identical. The only thing that has changed is the API endpoint. Additionally, if the Login API is a success, you're also storing the data in your <code>user</code> store and consequently updating your <code>localStorage</code>.</p>\n<p>Let's also test this out:</p>\n<p><img src=\"/431c32e3326ed149d1fccfa746e5829a/Login-API-Success.webp\" alt=\"Login API Success\"></p>\n<p>Let's also test an erroneous Login flow by entering the credentials for a user that doesn't exist:</p>\n<p><img src=\"/df37014cbbe64aa85cd395d049a791fa/Login-Error.webp\" alt=\"Login Error\"></p>\n<p>Great! Let's now tie all these individual pages together by setting up routing in your Svelte app.</p>\n<h2 id=\"setup-routes\" style=\"position:relative;\"><a href=\"#setup-routes\" aria-label=\"setup routes permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Setup Routes</h2>\n<p>You'll use the <code>svelte-navigator</code> package that you previously installed to configure routing in your app.</p>\n<h3 id=\"add-routing\" style=\"position:relative;\"><a href=\"#add-routing\" aria-label=\"add routing permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Add Routing</h3>\n<p>First, you'll define the routes for the Signup, Login, and Home pages inside your <code>App.svelte</code> file:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"26\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  /** IMPORTS */</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  import </span><span class=\"mtk4\">{</span><span class=\"mtk1\"> </span><span class=\"mtk12\">Router</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Route</span><span class=\"mtk1\"> </span><span class=\"mtk4\">}</span><span class=\"mtk1\"> from &quot;svelte-navigator&quot;;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">main</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Router</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">div</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Route</span><span class=\"mtk1\"> </span><span class=\"mtk12\">path</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;signup&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Signup</span><span class=\"mtk1\"> </span><span class=\"mtk4\">{</span><span class=\"mtk12\">sdkoptions</span><span class=\"mtk4\">}</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Route</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Route</span><span class=\"mtk1\"> </span><span class=\"mtk12\">path</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;login&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Login</span><span class=\"mtk1\"> </span><span class=\"mtk4\">{</span><span class=\"mtk12\">sdkoptions</span><span class=\"mtk4\">}</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Route</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Route</span><span class=\"mtk1\"> </span><span class=\"mtk12\">path</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;/&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Home</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Route</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">div</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Router</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">main</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>If you visit <code>/login</code>, you should see the Login Page. Similarly, if you go to <code>/signup</code>, you should see the Signup Page.</p>\n<h3 id=\"programmatic-redirection\" style=\"position:relative;\"><a href=\"#programmatic-redirection\" aria-label=\"programmatic redirection permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Programmatic Redirection</h3>\n<p>Remember, you had a link to the Signup page at the bottom of the Login page and vice versa?</p>\n<p>Also, your login page doesn't redirect anywhere after you login successfully. In order to programmatically navigate to a specific page on completion of an action, you can use the <code>useNavigate</code> hook from the <code>svelte-navigator</code> library.</p>\n<p>To use this hook, import <code>useNavigate</code> and save its invoked reference inside a variable, as follows:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"27\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  import </span><span class=\"mtk4\">{</span><span class=\"mtk12\">useNavigate</span><span class=\"mtk4\">}</span><span class=\"mtk1\"> from &quot;svelte-navigator&quot;; const navigate = useNavigate();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>Now call the <code>navigate()</code> function and pass the path of the page you wish to redirect to. So let's complete the <code>navigateToLogin</code> function inside your Signup component:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"28\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">... const navigateToLogin=()=&gt;navigate(&#39;/login&#39;); ...</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>Similarly, you can also complete the <code>navigateToSignup</code> function inside your Login component:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"29\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">... const navigateToSignup=()=&gt;navigate(&#39;/signup&#39;) ...</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>Finally, you'll also navigate to the Home page on a successful response from your Login API inside your Login component's <code>handleSubmit</code> function:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"30\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\"> </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">handleSubmit</span><span class=\"mtk1\">=(</span><span class=\"mtk12\">e</span><span class=\"mtk1\">)</span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">       ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk11\">fetch</span><span class=\"mtk1\">(</span><span class=\"mtk12\">endpoint</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">       ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        .</span><span class=\"mtk11\">then</span><span class=\"mtk1\">(</span><span class=\"mtk12\">data</span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> \t\t\t\t...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }</span><span class=\"mtk12\">else</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t\t\t...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk11\">navigate</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;/&#39;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        })</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">       ...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">&lt;/</span><span class=\"mtk12\">script</span><span class=\"mtk1\">&gt;</span></span></code></pre>\n<p>Great! You can now navigate from your Login page to the Signup page and vice versa. You should also be automatically redirected to the Home page on a successful login.</p>\n<h3 id=\"add-protectedprivate-routes\" style=\"position:relative;\"><a href=\"#add-protectedprivate-routes\" aria-label=\"add protectedprivate routes permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Add Protected/Private Routes</h3>\n<p>If you try to visit the Home component by entering the path <code>/</code> in the URL, you'll be able to see the Home page regardless of your authenticated state. However, you must protect this route so that it's only accessible to authenticated users in your application.</p>\n<p>For this purpose, you have created a <code>RouteGuard.svelte</code> file inside your <code>routes</code> folder. It's a higher-order component that uses the <code>useNavigation</code> hook to programmatically redirect to the login page if an unauthenticated user visits the home page. You use the <code>user</code> object from your Svelte store to validate the authenticated state of a user.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"31\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    import </span><span class=\"mtk4\">{</span><span class=\"mtk1\"> </span><span class=\"mtk12\">useNavigate</span><span class=\"mtk1\">, </span><span class=\"mtk12\">useLocation</span><span class=\"mtk1\"> </span><span class=\"mtk4\">}</span><span class=\"mtk1\"> from &quot;svelte-navigator&quot;;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    import </span><span class=\"mtk4\">{</span><span class=\"mtk1\"> </span><span class=\"mtk12\">user</span><span class=\"mtk1\"> </span><span class=\"mtk4\">}</span><span class=\"mtk1\"> from &quot;../stores&quot;;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    const navigate = useNavigate();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    const location = useLocation();</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    $: if (!$user) </span><span class=\"mtk4\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk11\">navigate</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/login&quot;</span><span class=\"mtk1\">, {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">state:</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">from:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">$location</span><span class=\"mtk1\">.</span><span class=\"mtk12\">pathname</span><span class=\"mtk1\"> },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">replace:</span><span class=\"mtk1\"> </span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      });</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  {#</span><span class=\"mtk15\">if</span><span class=\"mtk1\"> </span><span class=\"mtk12\">$user</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">slot</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  {/</span><span class=\"mtk15\">if</span><span class=\"mtk1\">}</span></span></code></pre>\n<p>You can then wrap another higher order Route component on top of the <code>RouteGuard</code> component inside the <code>PrivateRoutes.svelte</code> file, as follows:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"32\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    import </span><span class=\"mtk4\">{</span><span class=\"mtk1\"> </span><span class=\"mtk12\">Route</span><span class=\"mtk1\"> </span><span class=\"mtk4\">}</span><span class=\"mtk1\"> from &quot;svelte-navigator&quot;;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    import RouteGuard from &quot;./RouteGuard.svelte&quot;;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    export let path;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Route</span><span class=\"mtk1\"> </span><span class=\"mtk4\">{</span><span class=\"mtk12\">path</span><span class=\"mtk4\">}</span><span class=\"mtk1\"> </span><span class=\"mtk12\">let</span><span class=\"mtk1\">:</span><span class=\"mtk12\">params</span><span class=\"mtk1\"> </span><span class=\"mtk12\">let</span><span class=\"mtk1\">:</span><span class=\"mtk12\">location</span><span class=\"mtk1\"> </span><span class=\"mtk12\">let</span><span class=\"mtk1\">:</span><span class=\"mtk12\">navigate</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">RouteGuard</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">slot</span><span class=\"mtk1\"> </span><span class=\"mtk4\">{</span><span class=\"mtk12\">params</span><span class=\"mtk4\">}</span><span class=\"mtk1\"> </span><span class=\"mtk4\">{</span><span class=\"mtk12\">location</span><span class=\"mtk4\">}</span><span class=\"mtk1\"> </span><span class=\"mtk4\">{</span><span class=\"mtk12\">navigate</span><span class=\"mtk4\">}</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">RouteGuard</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Route</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>Now, all you need to do is use this <code>PrivateRoute</code> component to wrap your Home component instead of a regular Route component:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"33\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">PrivateRoute</span><span class=\"mtk1\"> </span><span class=\"mtk12\">path</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;/&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">let</span><span class=\"mtk1\">:</span><span class=\"mtk12\">location</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Home</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">PrivateRoute</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">...</span></span></code></pre>\n<p>And now you should be able to access the <code>/</code> route or the Home page only when you're authenticated:</p>\n<p><img src=\"/0b7bfdfedf02190c8f4cf508c3d5ae7d/Home-Component.webp\" alt=\"Home Component\"></p>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>I hope I've shed some light on how to authenticate Svelte apps. You can do a lot from here, like adding <a href=\"https://kit.svelte.dev/\">Svelte Kit</a> to this project to simplify the routing system for your Svelte application.</p>\n<p>You can <a href=\"https://github.com/LoginRadius/engineering-blog-samples/tree/master/Svelte/SvelteAuthApp\">refer to the entire source code for this tutorial here</a>.</p>\n<p>You can also explore <a href=\"https://accounts.loginradius.com/auth.aspx?plan=developer&#x26;action=register\">LoginRadius</a> to add forgot password functionality or social signups with Facebook and Google.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk6 { color: #D7BA7D; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk17 { color: #808080; }\n  .dark-default-dark .mtk14 { color: #F44747; }\n</style>","frontmatter":{"date":"March 10, 2022","updated_date":null,"title":"How to Authenticate Svelte Apps","tags":["Authentication","Svelte","LoginRadius"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/c47b7b41ce6f525c5d8fa037d7313ae0/58556/authenticate-svelte-apps.webp","srcSet":"/static/c47b7b41ce6f525c5d8fa037d7313ae0/61e93/authenticate-svelte-apps.webp 200w,\n/static/c47b7b41ce6f525c5d8fa037d7313ae0/1f5c5/authenticate-svelte-apps.webp 400w,\n/static/c47b7b41ce6f525c5d8fa037d7313ae0/58556/authenticate-svelte-apps.webp 800w,\n/static/c47b7b41ce6f525c5d8fa037d7313ae0/99238/authenticate-svelte-apps.webp 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Siddhant Varma","github":"FuzzySid","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/guest-post/nextjs-authentication-guide/"},"html":"<p>In this article, you'll learn about authentication in Next.js and how you can authenticate Next.js applications with <a href=\"https://www.loginradius.com/\">LoginRadius</a>.</p>\n<blockquote>\n<p><strong>Note:</strong> An understanding of <a href=\"https://reactjs.org/\">React</a>, <a href=\"https://www.loginradius.com/blog/engineering/react-hooks-guide/\">Hooks</a>, and <a href=\"https://nextjs.org/\">Next.js</a> is beneficial to follow this tutorial.</p>\n</blockquote>\n<h2 id=\"what-is-authentication\" style=\"position:relative;\"><a href=\"#what-is-authentication\" aria-label=\"what is authentication permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is Authentication?</h2>\n<p>Authentication is the process of validating that an individual is who they claim to be. Authentication is an essential feature for applications, particularly those that store user data.</p>\n<p>You should not mistake authentication for authorization. Authorization is the process of verifying that whether a user has required permission to access an asset or data set.</p>\n<p>Authentication deals with identifying a user, while authorization checks what resources or data an authenticated user has permission to access.</p>\n<p>Some of the methods used to implement authentication are:</p>\n<ul>\n<li>Username/email and password</li>\n<li>Fingerprint</li>\n<li>Face recognition</li>\n<li>Security questions</li>\n<li>One time pins (OTPs)</li>\n<li>Magic links</li>\n</ul>\n<h2 id=\"should-you-build-your-authentication-system-or-use-a-third-party-solution\" style=\"position:relative;\"><a href=\"#should-you-build-your-authentication-system-or-use-a-third-party-solution\" aria-label=\"should you build your authentication system or use a third party solution permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Should You Build Your Authentication System or Use a Third-party Solution?</h2>\n<p>Authentication is one of the most critical parts of an application’s security, so you should address it adequately.</p>\n<p>A few aspects you should consider when assessing if you should build your authentication system or use a third-party solution:</p>\n<ul>\n<li><strong>Progressive Enhancements:</strong> Security systems require frequent enhancements and upgrades to keep users safe from evolving threats and techniques. How much time and resources can you commit to keeping your security system up-to-date with the latest countermeasures to safeguard data and access against emerging threats?</li>\n<li>\n<p><strong>Identity Provider Support:</strong> How many identity providers do you plan to support, if any? With third-party solutions, you can authenticate users with email/password as well as identity providers such as Google, Github, Facebook, and more. Third-party solutions are always working hard to add support to even more providers. They also provide other authentication methods like Magic Link for passwordless authentication.</p>\n<p>Can you build an authentication system that allows users to use their preferred authentication method, or will they be restricted?</p>\n</li>\n<li>\n<p><strong>Advanced Security Features:</strong> Security and authentication go beyond email/password sign-in. Most third-party solutions provide necessary features, such as email confirmation, two-factor authentication (2FA), etc.</p>\n<p>You should let the security experts such as LoginRadius do what they do best while focusing on your main tasks — building excellent applications.</p>\n</li>\n</ul>\n<p>Considering these factors, it's pretty easier to rely on a third-party solution, and it's also cheaper and more secure than building your own authentication system.</p>\n<h2 id=\"what-is-loginradius\" style=\"position:relative;\"><a href=\"#what-is-loginradius\" aria-label=\"what is loginradius permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is LoginRadius?</h2>\n<blockquote>\n<p>Loginradius is the world's first no-code identity platform. It is a simple, implementable solution for adding user authentication and authorization to your website.</p>\n</blockquote>\n<p>LoginRadius provides no-code services for authorization, authentication, account security, and much more. It has several interesting features, and some of them are:</p>\n<ul>\n<li><a href=\"https://www.loginradius.com/social-login/\">Social login</a></li>\n<li><a href=\"https://www.loginradius.com/passwordless-login/\">Passwordless login</a></li>\n<li><a href=\"https://www.loginradius.com/standard-login/\">Standard login (email and password)</a></li>\n<li><a href=\"https://www.loginradius.com/multi-factor-authentication/\">Multi-factor authentication</a></li>\n<li><a href=\"https://www.loginradius.com/phone-login/\">Phone login</a></li>\n<li><a href=\"https://www.loginradius.com/single-sign-on/\">Single sign-on</a></li>\n<li><a href=\"https://www.loginradius.com/profile-management/\">User management</a></li>\n</ul>\n<h2 id=\"understanding-nextjs-authentication-patterns\" style=\"position:relative;\"><a href=\"#understanding-nextjs-authentication-patterns\" aria-label=\"understanding nextjs authentication patterns permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Understanding Next.js Authentication Patterns</h2>\n<p>Next.js offers two authentication patterns — client-side and server-side authentication.</p>\n<h3 id=\"client-side-authentication\" style=\"position:relative;\"><a href=\"#client-side-authentication\" aria-label=\"client side authentication permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Client-Side Authentication</h3>\n<p>With client-side authentication, the authentication logic and user redirection are done in the browser. The page component fully loads before the redirect logic is executed.</p>\n<p>When this authentication approach is used, developers usually use a loading indicator to indicate to the user that a process is running in the background. The loading indicator helps boost user experience. If the user’s authentication fails, redirect the user to a login page.</p>\n<p>The following example shows how to handle client-side redirects:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">useEffect</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;react&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">useRouter</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;next/router&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> </span><span class=\"mtk12\">authService</span><span class=\"mtk1\"> </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;auth-service&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk3\">//imaginary auth service</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk15\">default</span><span class=\"mtk1\"> </span><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">ProtectedPage</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">router</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">useRouter</span><span class=\"mtk1\">()</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk11\">useEffect</span><span class=\"mtk1\">(() </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">authUser</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">authService</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getUser</span><span class=\"mtk1\">()</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk3\">// if there is no authenticated user, redirect to login page_</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (!</span><span class=\"mtk12\">authUser</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">router</span><span class=\"mtk1\">.</span><span class=\"mtk11\">push</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/login&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  }, [])</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">h1</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Welcome </span><span class=\"mtk4\">{</span><span class=\"mtk12\">user</span><span class=\"mtk1\">.</span><span class=\"mtk12\">name</span><span class=\"mtk4\">}</span><span class=\"mtk1\">. This is a protected page</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">h1</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">`</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  )</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>The above code snippet handles client-side redirects in the browser using <a href=\"https://nextjs.org/docs/api-reference/next/router\">next/router</a>. It also uses an imaginary authentication service, <code>auth-service</code>, for illustration purposes. You’ll work with LoginRadius later in this tutorial.</p>\n<p>It checks if there is an authenticated user with the <code>authService.getUser()</code> method in the <code>useEffect</code>. If there is none, it redirects the user to the <code>/login</code> page using Next.js’s router object.</p>\n<p>This is a simple illustration of client-side authentication and redirection.</p>\n<h3 id=\"server-side-authentication\" style=\"position:relative;\"><a href=\"#server-side-authentication\" aria-label=\"server side authentication permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Server-Side Authentication</h3>\n<p>With server-side authentication, you can redirect a user from, say, <code>pages/profile</code> to <code>pages/login</code>. When non-authenticated users try to access a protected page, they are redirected to a login page. All of this is done on the server — before the request reaches the browser.</p>\n<p>A benefit of this pattern is that non-authenticated users do not see flashes of unauthenticated content before they are redirected.</p>\n<p>The following example below shows how to handle server-side redirects:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk15\">default</span><span class=\"mtk1\"> </span><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">ProtectedPage</span><span class=\"mtk1\">({ </span><span class=\"mtk12\">user</span><span class=\"mtk1\"> }) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk15\">return</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk17\">&lt;&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t\t</span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">h1</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Welcome </span><span class=\"mtk4\">{</span><span class=\"mtk12\">user</span><span class=\"mtk1\">.</span><span class=\"mtk12\">name</span><span class=\"mtk4\">}</span><span class=\"mtk1\">. This is a protected page</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">h1</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk17\">&lt;/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">getServerSideProps</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">async</span><span class=\"mtk1\"> </span><span class=\"mtk12\">context</span><span class=\"mtk1\"> </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk4\">const</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">user</span><span class=\"mtk1\"> } = </span><span class=\"mtk12\">authService</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getUser</span><span class=\"mtk1\">(</span><span class=\"mtk12\">context</span><span class=\"mtk1\">.</span><span class=\"mtk12\">req</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">// if there is no authenticated user, redirect to login page</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (!</span><span class=\"mtk12\">user</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk15\">return</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t\t</span><span class=\"mtk12\">props:</span><span class=\"mtk1\"> {},</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t\t</span><span class=\"mtk12\">redirect:</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">destination:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;/login&quot;</span><span class=\"mtk1\"> },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk15\">return</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">props:</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">user</span><span class=\"mtk1\"> } }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>Using <code>getServerSideProps</code> enables rendering pages on the server. You can take advantage of that to also handle the redirection on the server.</p>\n<p>The above code snippet uses the <code>authService.getUser()</code> method to get the authenticated user’s object. If there is no user, it returns an object with a <code>redirect</code> object. The <code>redirect</code> object contains a <code>destination</code> key, where you can put the page you want to redirect the user to, which is your application’s login page.</p>\n<p>Now that you’ve understood the authentication patterns available, let’s see how to authenticate a Next.js application with LoginRadius.</p>\n<h2 id=\"authenticating-nextjs-apps-with-loginradius\" style=\"position:relative;\"><a href=\"#authenticating-nextjs-apps-with-loginradius\" aria-label=\"authenticating nextjs apps with loginradius permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Authenticating Next.js Apps with LoginRadius</h2>\n<p>The steps below highlight how you can integrate and authenticate your Next.js applications with LoginRadius:</p>\n<h3 id=\"create-a-loginradius-account\" style=\"position:relative;\"><a href=\"#create-a-loginradius-account\" aria-label=\"create a loginradius account permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Create a LoginRadius Account</h3>\n<p>You should <a href=\"https://accounts.loginradius.com/auth.aspx?return_url=https://dashboard.loginradius.com/login&#x26;action=register\">create an account</a> to get started with LoginRadius. There is a free plan you can start with.</p>\n<h3 id=\"get-account-credentials\" style=\"position:relative;\"><a href=\"#get-account-credentials\" aria-label=\"get account credentials permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Get Account Credentials</h3>\n<p>Now that you have an account, you should <a href=\"https://www.loginradius.com/developers/\">get the credentials</a> for your <code>appName</code> and <code>apiKey</code> from the dashboard. You'll need them later to use the React SDK.</p>\n<h3 id=\"start-a-new-nextjs-application\" style=\"position:relative;\"><a href=\"#start-a-new-nextjs-application\" aria-label=\"start a new nextjs application permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Start a New Next.js Application</h3>\n<p>Run the following command in your terminal to create a new Next.js application:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">npx</span><span class=\"mtk1\"> </span><span class=\"mtk12\">create</span><span class=\"mtk1\">-</span><span class=\"mtk12\">next</span><span class=\"mtk1\">-</span><span class=\"mtk12\">app</span><span class=\"mtk1\"> &lt;</span><span class=\"mtk12\">name</span><span class=\"mtk1\">-</span><span class=\"mtk4\">of</span><span class=\"mtk1\">-</span><span class=\"mtk12\">project</span><span class=\"mtk1\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">//or</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">yarn</span><span class=\"mtk1\"> </span><span class=\"mtk12\">add</span><span class=\"mtk1\"> </span><span class=\"mtk12\">create</span><span class=\"mtk1\">-</span><span class=\"mtk12\">next</span><span class=\"mtk1\">-</span><span class=\"mtk12\">app</span><span class=\"mtk1\"> &lt;</span><span class=\"mtk12\">name</span><span class=\"mtk1\">-</span><span class=\"mtk4\">of</span><span class=\"mtk1\">-</span><span class=\"mtk12\">project</span><span class=\"mtk1\">&gt;</span></span></code></pre>\n<h3 id=\"install-loginradius-react-sdk\" style=\"position:relative;\"><a href=\"#install-loginradius-react-sdk\" aria-label=\"install loginradius react sdk permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Install LoginRadius React SDK</h3>\n<p>Next, install the <a href=\"https://github.com/LoginRadius/loginradius-react\">React SDK</a> into the project:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">```javascript</span>\n<span class=\"grvsc-line\">npm install loginradius-react</span>\n<span class=\"grvsc-line\">//or</span>\n<span class=\"grvsc-line\">yarn add loginradius-react</span>\n<span class=\"grvsc-line\">```</span></code></pre>\n<h3 id=\"integrate-the-react-sdk\" style=\"position:relative;\"><a href=\"#integrate-the-react-sdk\" aria-label=\"integrate the react sdk permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Integrate the React SDK</h3>\n<p>You need to wrap the root component with the SDK’s authentication provider.</p>\n<p>You also need to pass the account credentials to the provider. You can get these credentials from your LoginRadius account dashboard.</p>\n<p>Navigate to <code>pages/_app.js</code> and update it with the code below:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> </span><span class=\"mtk12\">Head</span><span class=\"mtk1\"> </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;next/head&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">LRAuthProvider</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;loginradius-react&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">ChakraProvider</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;@chakra-ui/react&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> </span><span class=\"mtk12\">Layout</span><span class=\"mtk1\"> </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../layout&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../styles/globals.css&quot;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">MyApp</span><span class=\"mtk1\">({ </span><span class=\"mtk12\">Component</span><span class=\"mtk1\">, </span><span class=\"mtk12\">pageProps</span><span class=\"mtk1\"> }) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Head</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">title</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Loginradius Next</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">title</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Head</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">LRAuthProvider</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">appName</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;your-app-name&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">apiKey</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;your-api-key&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">redirectUri</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk8\">&quot;http://localhost:3000/&quot;</span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">ChakraProvider</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Layout</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Component</span><span class=\"mtk1\"> </span><span class=\"mtk4\">{</span><span class=\"mtk1\">...</span><span class=\"mtk12\">pageProps</span><span class=\"mtk4\">}</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Layout</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">ChakraProvider</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">LRAuthProvider</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  )</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk15\">default</span><span class=\"mtk1\"> </span><span class=\"mtk12\">MyApp</span></span></code></pre>\n<p>The above code snippet imports the <code>LRAuthProvider</code> component from <code>loginradius-react</code>. It passes the <code>appName</code> and <code>apiKey</code> taken from the LoginRadius account dashboard earlier to <code>LRAuthProvider</code>. It also sets the <code>redirectUri</code> to <code>http://localhost:3000/</code>.</p>\n<p>The <code>redirectUri</code> is the callback URL where you want to redirect users after being authenticated. You should <a href=\"https://www.loginradius.com/developers/\">whitelist the <code>redirect_uri</code> in your LoginRadius account dashboard</a>. Localhost URLs are whitelisted by default.</p>\n<p>Now that you've integrated the SDK, let’s add the authentication functionality.</p>\n<h3 id=\"add-login-and-logout-functionality\" style=\"position:relative;\"><a href=\"#add-login-and-logout-functionality\" aria-label=\"add login and logout functionality permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Add Login and Logout Functionality</h3>\n<p>Your users should be able to log in and out of our application, so let’s set that up.</p>\n<p>We will add the log in and log out functionality to a <code>Nav</code> component. Let’s set up the component.</p>\n<p>Create a <code>layout</code> folder in the root directory, and create a <code>Nav.js</code> file there. Add the following code to <code>Nav.js</code>:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">Button</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Flex</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Stack</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;@chakra-ui/react&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">useLRAuth</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;loginradius-react&quot;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk15\">default</span><span class=\"mtk1\"> </span><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">Nav</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">loginWithRedirect</span><span class=\"mtk1\">, </span><span class=\"mtk12\">logout</span><span class=\"mtk1\"> } = </span><span class=\"mtk11\">useLRAuth</span><span class=\"mtk1\">()</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Flex</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Stack</span><span class=\"mtk1\"> </span><span class=\"mtk12\">spacing</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk1\">[</span><span class=\"mtk7\">6</span><span class=\"mtk1\">, </span><span class=\"mtk7\">8</span><span class=\"mtk1\">]</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Button</span><span class=\"mtk1\"> </span><span class=\"mtk12\">onClick</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk1\">() </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk11\">loginWithRedirect</span><span class=\"mtk1\">()</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Login to continue</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Button</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Button</span><span class=\"mtk1\"> </span><span class=\"mtk12\">onClick</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk1\">() </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk11\">logout</span><span class=\"mtk1\">()</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Log out</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Button</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Stack</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Flex</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  )</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>Here, <a href=\"https://chakra-ui.com/\">Chakra UI</a> is used for UI components.</p>\n<p>First, it imports the <code>useLRAuth</code> hook from the SDK. Next, it accesses the <code>loginWithRedirect</code> and <code>logout</code> methods from the <code>useLRAuth</code> hook.</p>\n<p>Then, it passes <code>loginWithRedirect</code> and <code>logout</code> to the login and logout buttons’ <code>onClick</code> event handlers, respectively.</p>\n<p>Having created the <code>Nav</code> component, we need to create the <code>Layout</code> component we mentioned earlier.</p>\n<p>Create an <code>index.js</code> file in the <code>layout</code> folder, and paste the code below:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">Box</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;@chakra-ui/react&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> </span><span class=\"mtk12\">Nav</span><span class=\"mtk1\"> </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;./Nav&quot;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk15\">default</span><span class=\"mtk1\"> </span><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">Layout</span><span class=\"mtk1\">({ </span><span class=\"mtk12\">children</span><span class=\"mtk1\"> }) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Box</span><span class=\"mtk1\"> </span><span class=\"mtk12\">h</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;100vh&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">bg</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;green.50&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Nav</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Box</span><span class=\"mtk17\">&gt;</span><span class=\"mtk4\">{</span><span class=\"mtk12\">children</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Box</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Box</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  )</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>With that, you've added authentication to your application. However, you need a way to track the authentication state. You need to know if there is a logged-in user and do something with that information.</p>\n<h3 id=\"tracking-authentication-state\" style=\"position:relative;\"><a href=\"#tracking-authentication-state\" aria-label=\"tracking authentication state permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Tracking Authentication State</h3>\n<p>The SDK also provides <code>error</code> and <code>user</code> objects, along with <code>isLoading</code> and <code>isAuthenticated</code> booleans. You'll use these to track the authentication state.</p>\n<p>You can access information about an authenticated user, such as their email address, from the <code>user</code> object. If any, you can display error messages from the <code>error</code> object.</p>\n<p><code>isAuthenticated</code> returns true if there is an authenticated user and false if there is not.</p>\n<p>We are currently rendering both the login and logout buttons in the <code>Nav</code> component. However, we don’t want that. We want to display the login button when there is no authenticated user and logout when there is an authenticated user.</p>\n<p>Let’s update the <code>Nav.js</code> file with the code below to fix that:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">Button</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Flex</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Stack</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;@chakra-ui/react&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">useLRAuth</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;loginradius-react&quot;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk15\">default</span><span class=\"mtk1\"> </span><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">Nav</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">isAuthenticated</span><span class=\"mtk1\">, </span><span class=\"mtk12\">user</span><span class=\"mtk1\">, </span><span class=\"mtk12\">loginWithRedirect</span><span class=\"mtk1\">, </span><span class=\"mtk12\">logout</span><span class=\"mtk1\"> } = </span><span class=\"mtk11\">useLRAuth</span><span class=\"mtk1\">()</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Flex</span><span class=\"mtk1\"> </span><span class=\"mtk12\">as</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;nav&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Stack</span><span class=\"mtk1\"> </span><span class=\"mtk12\">spacing</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk1\">[</span><span class=\"mtk7\">6</span><span class=\"mtk1\">, </span><span class=\"mtk7\">8</span><span class=\"mtk1\">]</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">{</span><span class=\"mtk1\">!</span><span class=\"mtk12\">user</span><span class=\"mtk1\"> && (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Button</span><span class=\"mtk1\"> </span><span class=\"mtk12\">onClick</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk1\">() </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk11\">loginWithRedirect</span><span class=\"mtk1\">()</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Login to continue</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Button</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        )</span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">{</span><span class=\"mtk12\">isAuthenticated</span><span class=\"mtk1\"> && </span><span class=\"mtk12\">user</span><span class=\"mtk1\"> && (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Button</span><span class=\"mtk1\"> </span><span class=\"mtk12\">onClick</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk1\">() </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk11\">logout</span><span class=\"mtk1\">()</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Log out</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Button</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        )</span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Stack</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Flex</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  )</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>We conditionally display the login and logout buttons based on the authentication state.</p>\n<p>If there is a logged-in user, we want to redirect them to the profile page.</p>\n<p>Navigate to <code>pages/index.js</code> file and update it with the code below:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"8\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">useEffect</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;react&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">useRouter</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;next/router&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">useLRAuth</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;loginradius-react&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">Button</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Heading</span><span class=\"mtk1\">, </span><span class=\"mtk12\">VStack</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Center</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;@chakra-ui/react&quot;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk15\">default</span><span class=\"mtk1\"> </span><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">Home</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">isLoading</span><span class=\"mtk1\">, </span><span class=\"mtk12\">isAuthenticated</span><span class=\"mtk1\">, </span><span class=\"mtk12\">error</span><span class=\"mtk1\">, </span><span class=\"mtk12\">user</span><span class=\"mtk1\"> } = </span><span class=\"mtk11\">useLRAuth</span><span class=\"mtk1\">()</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">router</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">useRouter</span><span class=\"mtk1\">()</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk11\">useEffect</span><span class=\"mtk1\">(() </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">user</span><span class=\"mtk1\"> && </span><span class=\"mtk12\">isAuthenticated</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">router</span><span class=\"mtk1\">.</span><span class=\"mtk11\">push</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/profile&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  }, [</span><span class=\"mtk12\">router</span><span class=\"mtk1\">, </span><span class=\"mtk12\">user</span><span class=\"mtk1\">, </span><span class=\"mtk12\">isAuthenticated</span><span class=\"mtk1\">])</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">isLoading</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">div</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Loading...</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">div</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">error</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">div</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Oops... </span><span class=\"mtk4\">{</span><span class=\"mtk12\">error</span><span class=\"mtk1\">.</span><span class=\"mtk12\">message</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">div</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Center</span><span class=\"mtk1\"> </span><span class=\"mtk12\">pt</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk7\">10</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">VStack</span><span class=\"mtk1\"> </span><span class=\"mtk12\">spacing</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk1\">[</span><span class=\"mtk7\">6</span><span class=\"mtk1\">, </span><span class=\"mtk7\">8</span><span class=\"mtk1\">]</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Heading</span><span class=\"mtk1\"> </span><span class=\"mtk12\">as</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;h2&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Welcome</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Heading</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Text</span><span class=\"mtk1\"> </span><span class=\"mtk12\">fontSize</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;3xl&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Login to continue</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Text</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">VStack</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Center</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  )</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>Let’s break down the above code snippet:</p>\n<ul>\n<li>In the <code>useEffect</code>, it checks if there is a user object and if <code>isAuthenticated</code> is true. If these conditions are true, it redirects the user to their profile page. These conditions will only be true when the user has logged in. You'll set up the profile page later.</li>\n<li>It checks if the page is loading using the <code>isLoading</code> boolean. If true, it displays “loading…”. In a production-ready application, you would display a loading spinner.</li>\n<li>If there is an error during the authentication process, it accesses the message from the <code>error</code> object and displays it to the user.</li>\n<li>Finally, return some JSX.</li>\n</ul>\n<h3 id=\"displaying-authenticated-user-data\" style=\"position:relative;\"><a href=\"#displaying-authenticated-user-data\" aria-label=\"displaying authenticated user data permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Displaying Authenticated User Data</h3>\n<p>You have to display information about the authenticated user. Let’s set that up.\nCreate a profile.js file in the pages directory and paste the code below:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">Box</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Center</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Heading</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;@chakra-ui/react&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">useLRAuth</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;loginradius-react&quot;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk15\">default</span><span class=\"mtk1\"> </span><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">Profile</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">user</span><span class=\"mtk1\">, </span><span class=\"mtk12\">isLoading</span><span class=\"mtk1\">, </span><span class=\"mtk12\">isAuthenticated</span><span class=\"mtk1\"> } = </span><span class=\"mtk11\">useLRAuth</span><span class=\"mtk1\">()</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">isLoading</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">div</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Loading...</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">div</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">isAuthenticated</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Box</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Center</span><span class=\"mtk1\"> </span><span class=\"mtk12\">mt</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk7\">10</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Heading</span><span class=\"mtk1\"> </span><span class=\"mtk12\">a</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;h2&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            Welcome to your profile </span><span class=\"mtk4\">{</span><span class=\"mtk12\">user</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Email</span><span class=\"mtk1\">[</span><span class=\"mtk7\">0</span><span class=\"mtk1\">].</span><span class=\"mtk12\">Value</span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">          </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Heading</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Center</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">Box</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    )</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>You should display a user’s information if they're authenticated. Here, you check that they're authenticated with the <code>isAuthenticated</code> hook. If they're authenticated, return some JSX and display the user’s email address.</p>\n<h3 id=\"protecting-a-route\" style=\"position:relative;\"><a href=\"#protecting-a-route\" aria-label=\"protecting a route permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Protecting a Route</h3>\n<p>You can create protected routes to ensure only authenticated users can access those routes.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">withAuthenticationRequired</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;loginradius-react&quot;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">Profile</span><span class=\"mtk1\"> = () </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">isAuthenticated</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk15\">return</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t\t</span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Box</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t\t\t</span><span class=\"mtk14\">...markup</span><span class=\"mtk1\"> </span><span class=\"mtk12\">goes</span><span class=\"mtk1\"> </span><span class=\"mtk12\">here</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t\t</span><span class=\"mtk14\">&lt;/Box</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk14\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk14\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk14\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">export</span><span class=\"mtk1\"> </span><span class=\"mtk12\">default</span><span class=\"mtk1\"> </span><span class=\"mtk14\">withAuthenticationRequired(Profile,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk3\">//Show a message while the user waits to be redirected to the login page.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk14\">onRedirecting:</span><span class=\"mtk1\"> </span><span class=\"mtk14\">()</span><span class=\"mtk1\"> </span><span class=\"mtk14\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk14\">(</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk14\">&lt;div&gt;Redirecting</span><span class=\"mtk1\"> </span><span class=\"mtk12\">you</span><span class=\"mtk1\"> </span><span class=\"mtk12\">to</span><span class=\"mtk1\"> </span><span class=\"mtk12\">LoginRadius</span><span class=\"mtk1\"> </span><span class=\"mtk12\">awesome</span><span class=\"mtk1\"> </span><span class=\"mtk12\">Login</span><span class=\"mtk1\"> </span><span class=\"mtk14\">page&lt;/div&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk14\">),</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk14\">});</span></span></code></pre>\n<p>Here, the code snippet uses the <code>withAuthenticationRequired</code> higher-order component to wrap the <code>Profile</code> component. With this, anytime an unauthenticated user tries to access the <code>/profile</code> route, they'll be redirected to LoginRadius’s login page and then back to <code>/profile</code> after they log in.</p>\n<p>The image below shows an authenticated user's profile page.</p>\n<p><img src=\"/628d48eec1fa72e582fdd05f76b085e4/profile-page.webp\" alt=\"An authenticated user&#x27;s profile page\"></p>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>In this tutorial, you have learned about user authentication and understood whether you should develop an authentication system in-house or use a modern identity platform like LoginRadius.</p>\n<p>Then, you have briefly learned different authentication patterns available in Next.js. And you step-by-step understood how to authenticate Next.js applications with LoginRadius’s React SDK.</p>\n<p>A working version of the code used in this tutorial <a href=\"https://github.com/LoginRadius/engineering-blog-samples/tree/master/Nextjs/next-auth-demo\">is available on Github</a>.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk17 { color: #808080; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk14 { color: #F44747; }\n</style>","frontmatter":{"date":"January 13, 2022","updated_date":null,"title":"Your Ultimate Guide to Next.js Authentication","tags":["Authentication","React","Next.js","LoginRadius"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7699115044247788,"src":"/static/6a3f9e6ed0b8803f9523875b01d55a37/58556/next-authentication.webp","srcSet":"/static/6a3f9e6ed0b8803f9523875b01d55a37/61e93/next-authentication.webp 200w,\n/static/6a3f9e6ed0b8803f9523875b01d55a37/1f5c5/next-authentication.webp 400w,\n/static/6a3f9e6ed0b8803f9523875b01d55a37/58556/next-authentication.webp 800w,\n/static/6a3f9e6ed0b8803f9523875b01d55a37/99238/next-authentication.webp 1200w,\n/static/6a3f9e6ed0b8803f9523875b01d55a37/7c22d/next-authentication.webp 1600w,\n/static/6a3f9e6ed0b8803f9523875b01d55a37/25f09/next-authentication.webp 1920w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Emadamerho-Atori Nefe","github":"nefejames","avatar":null}}}},{"node":{"fields":{"slug":"/identity/loginradius-top-performing-blogs-2021/"},"html":"<p>2021 was a remarkable year since businesses began overcoming challenges and uncertainties worldwide amid the global pandemic. </p>\n<p>Regardless of the industry, almost every organization bounced back and made every effort to stay up and running in the most unpredictable times. </p>\n<p>As far as the consumer identity and access management (CIAM) industry is concerned, LoginRadius was one of the top performers in securing billions of identities and educating the global audience regarding the diverse aspects of CIAM and security. </p>\n<p>Our insightful blogs helped millions of people globally understand, implement, and enhance their platform experience by leveraging cutting-edge technology in the CIAM landscape. </p>\n<p>In this post, we’ve narrowed down the list of our Top 10 Performing Blogs in 2021 that people across the globe found insightful as they helped them cut corners during the unpredicted times. </p>\n<p>We hope you’ll find a topic you’re excited about and will get the most accurate and in-depth information about the same. Let’s get started. </p>\n<h3 id=\"10-how-to-set-up-two-factor-authentication-on-all-your-online-accounts\" style=\"position:relative;\"><a href=\"#10-how-to-set-up-two-factor-authentication-on-all-your-online-accounts\" aria-label=\"10 how to set up two factor authentication on all your online accounts permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>#10. How to Set Up Two-factor Authentication on All Your Online Accounts?</h3>\n<p>Two-factor authentication is one of the best security methods that use two layers to verify a consumer's identity. </p>\n<p>This means, rather than simply entering the password to log into an account, two-factor authentication requires a code sent via text message to the consumer's phone number or generated through an app.</p>\n<p>Read this blog to learn everything about two-factor authentication, <a href=\"https://www.loginradius.com/blog/identity/how-to-setup-2fa-in-online-accounts/\">how to set up two-factor authentication</a> on your social accounts, and its importance. </p>\n<h3 id=\"9-what-is-a-salt-and-how-does-it-boost-security\" style=\"position:relative;\"><a href=\"#9-what-is-a-salt-and-how-does-it-boost-security\" aria-label=\"9 what is a salt and how does it boost security permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>#9. What Is a Salt and How Does It Boost Security?</h3>\n<p>Salting hashes sounds like something that comes out of a recipe book. However, Salt plays a significant role in preventing a data breach in cryptography. </p>\n<p>While data leaks can sometimes happen, hash salting generators only come to mind when there is a significant invasion of privacy that affects the majority of the consumers’ applications.</p>\n<p>Read this blog to know more about <a href=\"https://www.loginradius.com/blog/identity/what-is-salt/\">Salt</a>, utilizing hashing using Salt, and its importance in enhancing overall password security. </p>\n<h3 id=\"8-identity-management-in-cloud-computing\" style=\"position:relative;\"><a href=\"#8-identity-management-in-cloud-computing\" aria-label=\"8 identity management in cloud computing permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>#8. Identity Management in Cloud Computing</h3>\n<p><a href=\"https://www.loginradius.com/blog/identity/identity-management-in-cloud-computing/\">Identity management in cloud computing</a> is the subsequent identity and access management (IAM) solution. </p>\n<p>However, it is a lot more than merely a straightforward web app single sign-on (SSO) solution. This next generation of IAM solution is a holistic move of the identity provider right to the cloud.</p>\n<p>This blog covers all the aspects of cloud IAM, its significance, and businesses must incline towards a modern cloud identity management solution. </p>\n<h3 id=\"7-a-detailed-guide-on-how-uxui-affects-registration\" style=\"position:relative;\"><a href=\"#7-a-detailed-guide-on-how-uxui-affects-registration\" aria-label=\"7 a detailed guide on how uxui affects registration permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>#7. A Detailed Guide on How UX/UI Affects Registration</h3>\n<p>Login is a big deal that decides the entire UX your website will deliver. Businesses should try to put as little resistance as possible into their registration process. </p>\n<p>As with it comes customer identities—the most accurate first-party data beneficial for conversions and customer retention.</p>\n<p><a href=\"https://www.loginradius.com/blog/identity/how-ui-ux-affects-registration/\">This blog</a> covers all the aspects associated with UI/UX along with the numerous benefits of using social login for your online platforms. </p>\n<h3 id=\"6-what-is-broken-authentication-and-how-to-prevent-your-company-from-it\" style=\"position:relative;\"><a href=\"#6-what-is-broken-authentication-and-how-to-prevent-your-company-from-it\" aria-label=\"6 what is broken authentication and how to prevent your company from it permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>#6. What Is Broken Authentication and How to Prevent Your Company From It</h3>\n<p>When the hacker gains access into the system admin's account by using the online platform's vulnerabilities, particularly in two areas: credential management and session management, it's referred to as broken authentication.</p>\n<p>Poor credential management and poor session management always lead to broken authentication. Read on this blog to know everything about <a href=\"https://www.loginradius.com/blog/identity/what-is-broken-authentication/\">broken authentication</a>, its consequences, and how to prevent it. </p>\n<h3 id=\"5-refresh-tokens-when-to-use-them-and-how-they-interact-with-jwts\" style=\"position:relative;\"><a href=\"#5-refresh-tokens-when-to-use-them-and-how-they-interact-with-jwts\" aria-label=\"5 refresh tokens when to use them and how they interact with jwts permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>#5. Refresh Tokens: When to Use Them and How They Interact with JWTs</h3>\n<p>A token plays a crucial role in enhancing the overall security mechanism of an organization that helps to deliver flawless and secure authentication and authorization on their website or application. </p>\n<p>With token security, users have to re-authenticate themselves for obvious security reasons by offering credentials to sign in if the access token is expired. </p>\n<p>However, this can be tedious and hampers user experience. To overcome this, the concept of refresh tokens was introduced.</p>\n<p>This blog provides an overview of using <a href=\"https://www.loginradius.com/blog/identity/refresh-tokens-jwt-interaction/\">refresh tokens</a> and helps securely authenticate users without hampering their overall experience. </p>\n<h3 id=\"4-the-rise-of-byoi-bring-your-own-identity\" style=\"position:relative;\"><a href=\"#4-the-rise-of-byoi-bring-your-own-identity\" aria-label=\"4 the rise of byoi bring your own identity permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>#4. The Rise of BYOI (Bring your own Identity)</h3>\n<p>Consumers demand a more innovative experience today. They don't like to create a new ID whenever they want to utilize a service. Instead, they are open to leveraging their existing digital identity securely and efficiently, with the opportunity to reuse it in multiple domains.</p>\n<p>And as a response to this demand, businesses have come up with a concept called Bring Your Own Identity (BYOI).</p>\n<p>Read on this blog to learn every aspect of <a href=\"https://www.loginradius.com/blog/identity/bring-your-own-identity/\">BYOI</a>. </p>\n<h3 id=\"3-what-is-a-token-what-are-its-pros-and-cons\" style=\"position:relative;\"><a href=\"#3-what-is-a-token-what-are-its-pros-and-cons\" aria-label=\"3 what is a token what are its pros and cons permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>#3. What is a Token? What are its Pros and Cons?</h3>\n<p>Tokens are widely used to provide authorization and authentication to users when accessing a website or a mobile application. This post covers detailed information about tokens' use and their advantages and disadvantages.</p>\n<p><a href=\"https://www.loginradius.com/blog/identity/pros-cons-token-authentication/\">This blog</a> will help you better understand what a token is, what are its pros and cons and will help you decide whether you need to invoke the potential of tokens for your business or not.</p>\n<h3 id=\"2-how-nist-is-changing-password-creation-in-2021\" style=\"position:relative;\"><a href=\"#2-how-nist-is-changing-password-creation-in-2021\" aria-label=\"2 how nist is changing password creation in 2021 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>#2. How NIST is Changing Password Creation in 2021?</h3>\n<p>To cope with the increasing number of cyber frauds and data thefts, the National Institute of Standards and Technology (NIST) has issued specific requirements and controls for digital user identities.</p>\n<p>The NIST has dispensed several guidelines that ensure security to the user and eventually help enterprises secure their crucial business information.</p>\n<p>These guidelines offer recommendations for users for creating strong passwords and suggestions for vendors/verifiers handling passwords.</p>\n<p><a href=\"https://www.loginradius.com/blog/identity/nist-password-guidelines-2021/\">This blog</a> provides detailed information about NIST password guidelines and offers valuable insights into how businesses can ensure maximum security in 2021 and beyond.</p>\n<h3 id=\"1-the-future-of-authentication-is-passwordless-with-magic-links\" style=\"position:relative;\"><a href=\"#1-the-future-of-authentication-is-passwordless-with-magic-links\" aria-label=\"1 the future of authentication is passwordless with magic links permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>#1. The Future of Authentication is Passwordless With Magic links</h3>\n<p>This is perhaps the most popular blog that depicts the importance of passwordless in the modern digital world. </p>\n<p>A passwordless magic link allows you to log in directly with the help of a link that is received through an email. This process is similar to receiving a one-time password (OTP) though you might have to physically enter the OTP once you are redirected to the page or application. </p>\n<p>In the case of passwordless magic links, all you have to do is click on the link sent through an email, allowing you to log in directly.</p>\n<p><a href=\"https://www.loginradius.com/blog/identity/passwordless-magic-links/\">Read on this insightful blog</a> that covers all the aspects of passwordless login, challenges, and how organizations can use magic links for going passwordless. </p>\n<h2 id=\"bottom-line\" style=\"position:relative;\"><a href=\"#bottom-line\" aria-label=\"bottom line permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Bottom Line</h2>\n<p>The blogs mentioned above can help you understand the CIAM landscape and the crucial role of incorporating a cutting-edge consumer identity and access management solution. </p>\n<p>LoginRadius helps businesses deliver a flawless user experience backed by robust security through a world-class consumer identity and access management solution. </p>\n<p>Reach us to know more about LoginRadius CIAM and how it can help scale your business growth even in the most unpredictable times. </p>\n<p><a href=\"https://www.loginradius.com/contact-us?utm_source=blog&#x26;utm_medium=web&#x26;utm_campaign=loginradius-top-performing-blogs-2021\"><img src=\"/8fce571f703a5970dbb1359a2fe0e51a/book-a-demo-loginradius.webp\" alt=\"book-a-demo-loginradius\"></a></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"December 29, 2021","updated_date":null,"title":"Top 10 Performing Identity Blogs in 2021","tags":["LoginRadius"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7391304347826086,"src":"/static/412ef6bab129e2dc0cf8b99a5b731955/7f8e9/performing-blogs.webp","srcSet":"/static/412ef6bab129e2dc0cf8b99a5b731955/61e93/performing-blogs.webp 200w,\n/static/412ef6bab129e2dc0cf8b99a5b731955/1f5c5/performing-blogs.webp 400w,\n/static/412ef6bab129e2dc0cf8b99a5b731955/7f8e9/performing-blogs.webp 768w","sizes":"(max-width: 768px) 100vw, 768px"}}},"author":{"id":"Navanita Devi","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/hacktoberfest-2021/"},"html":"<h2 id=\"what-is-hacktoberfest-2021\" style=\"position:relative;\"><a href=\"#what-is-hacktoberfest-2021\" aria-label=\"what is hacktoberfest 2021 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is Hacktoberfest 2021?</h2>\n<p><a href=\"https://hacktoberfest.digitalocean.com/\">Hacktoberfest 2021</a> is the 8th edition of Hacktoberfest hosted by <a href=\"https://www.digitalocean.com/\">DigitalOcean</a>. It is an open source festival celebrated during October every year, encouraging people worldwide to actively participate and contribute to participating open source projects hosted across GitHub and GitLab.</p>\n<p>In fact, Hacktoberfest 2020 had attracted 169,886 participants and 116,361 participating open source repositories, representing 135 countries.</p>\n<p>You can simply <a href=\"https://hacktoberfest.digitalocean.com/\">register yourself here</a> and start contributing to any participating open source project from Oct 01 - Oct 31. And if you meet the <a href=\"https://hacktoberfest.digitalocean.com/resources/participation\">contribution criteria</a> set by DigitalOcean, you’ll receive a Hacktoberfest t-shirt from DigitalOcean!</p>\n<p>Additionally, if you make successful contributions to <a href=\"https://github.com/LoginRadius\">LoginRadius open source projects</a>, you’ll separately receive a LoginRadius branded Hacktoberfest t-shirt from us, recognizing and thanking you for your valuable contributions.</p>\n<h2 id=\"why-contribute-to-loginradius-open-source-projects\" style=\"position:relative;\"><a href=\"#why-contribute-to-loginradius-open-source-projects\" aria-label=\"why contribute to loginradius open source projects permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Why Contribute to LoginRadius Open Source Projects?</h2>\n<p>LoginRadius is an industry-leading Customer Identity and Access Management (CIAM) provider with a mission to secure every identity on this planet.</p>\n<p>At LoginRadius, we’re committed to making our cloud platform more accessible for developers across tech stacks, so they can quickly implement user registration and authentication processes in their applications and become more efficient at focusing on core business features.</p>\n<p>We’ve always loved open source and the many great things it has done for the software development community and businesses. This inspired us to open source many of our projects, including SDKs, LR CLI, and Async Blog, a leading publication for developers by developers.</p>\n<p>Through our open source projects, we actively collaborate with the developer community and drive change and innovation for the optimistic progress of everyone.</p>\n<p>When you contribute to our open source projects, you’re helping the whole developer community become efficient, productive, and helping them manage user identities and authentication on their applications securely and scalably.</p>\n<h2 id=\"how-to-contribute\" style=\"position:relative;\"><a href=\"#how-to-contribute\" aria-label=\"how to contribute permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How to Contribute?</h2>\n<p>The exciting part about being involved in the open source community is that no matter how small or big your contributions are, the community will welcome your efforts and collaborate with you positively, sharing feedback and expressing gratitude.</p>\n<p>Especially with <a href=\"https://github.com/LoginRadius\">LoginRadius open source projects</a>, your contributions can make a big difference! We also try making your collaboration with us more enjoyable.</p>\n<p>Please note that only contributions that add significant value to our projects will be eligible for swag. This will be at our sole discretion. But you may go ahead and contribute in any way you would like.</p>\n<h3 id=\"prerequisites\" style=\"position:relative;\"><a href=\"#prerequisites\" aria-label=\"prerequisites permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Prerequisites</h3>\n<p>You should have a basic to intermediate understanding of the following:</p>\n<ul>\n<li>Git</li>\n<li>GitHub</li>\n<li>Forking a repository</li>\n<li>Creating a pull request</li>\n</ul>\n<h3 id=\"repositories-for-contributing\" style=\"position:relative;\"><a href=\"#repositories-for-contributing\" aria-label=\"repositories for contributing permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Repositories for Contributing</h3>\n<p>Each of the following public repositories on GitHub will have a list of issues listed. You can choose to work on these issues based on your skills and expertise in solving them.</p>\n<p>At LoginRadius, we value your contributions and proactively collaborate with you to get your contribution accepted. </p>\n<p>But one thing to keep in mind is that we don’t tolerate spamming. </p>\n<p>So, what is spamming?</p>\n<p>Spamming is creating a pull request for the sake of it and not adding value in any way. We’ll identify spam pull requests and report them according to GitHub guidelines.</p>\n<p>Anyways, you don’t have to worry about spamming accidentally: it seldom occurs without a clear intention. If we identify something as spam, we’ll let you know and help you understand why it is marked as spam.</p>\n<p>You can also easily find issues with the <strong>hacktoberfest</strong> label in order to know which repositories are seeking contributions. Or, you can simply <a href=\"https://www.google.com/url?q=https://github.com/search?q%3Dorg%253ALoginRadius%2Blabel%253Ahacktoberfest%2Btype%253Aissue&#x26;sa=D&#x26;source=editors&#x26;ust=1632394834688000&#x26;usg=AOvVaw0wYGvdlJspvM887yP750Ms\">click here</a> to find all the issues needing contribution.</p>\n<p>That all being out of the way, here are the open source projects for which we’re seeking your valuable contributions:</p>\n<ul>\n<li>\n<p><strong><a href=\"https://github.com/LoginRadius/lr-cli\">LoginRadius CLI</a>:</strong> We understand that developers love the simplicity and efficiency offered by CLI. So, we recently launched CLI for LoginRadius, which helps implement and manage LoginRadius CIAM faster than ever.</p>\n<p>As our CLI still has room for becoming great, we seek your contributions in any way possible to make it better and help developers become more productive.</p>\n</li>\n<li>\n<p><strong><a href=\"https://github.com/LoginRadius/engineering-portal\">Async Blog</a>:</strong> This is our open source blog created for developers by developers. If you’ve expertise in solving issues and fixing errors, please come forward and share your expertise with the world.</p>\n<p>We have a few issues created for this repository based on our research about what problems developers are currently facing and trying to solve them. Share your expertise, write a blog, and be a holding hand for developers in need!</p>\n</li>\n<li><strong><a href=\"https://github.com/LoginRadius/docs\">LoginRadius Docs</a>:</strong> This is an extensive resource for developers and engineers for understanding LoginRadius and implementing it. Though this project is mature, as we keep on bringing innovations and features, we need developers who are already familiar with LoginRadius to embed their unique expertise and view on LoginRadius in our docs.</li>\n<li><strong><a href=\"https://github.com/LoginRadius/idx-auto-tester\">IDX Auto Tester</a>:</strong> This is LoginRadius Identity Experience Automation Framework, which includes automation scripts written in Nightwatch.js and Node.js Core Assertion Testing Library for assertions. If you’re a Nightwatch.js geek, this is the project for you to flex your coding muscles!</li>\n<li><strong><a href=\"https://github.com/LoginRadius/awesome-test-cases-collection\">Awesome Test Cases Collection</a>:</strong> This repository includes basic checks needed to verify various features of LoginRadius. If you’re a tester and already familiar with LoginRadius and its features, this is the project you can contribute to.</li>\n<li><strong><a href=\"https://github.com/LoginRadius/go-saml\">Go SAML</a>:</strong> This is a SAMl 2.0 implementation in Go for implementing single sign-on (SSO) using LoginRadius. This also allows you to integrate identity providers like Google, Facebook, and Twitter on your applications. Contribute to this project to make SSO much more accessible for developers. </li>\n<li><strong><a href=\"https://github.com/LoginRadius/business-email-validator\">Business Email Validator</a>:</strong> This project focuses on only allowing business email domains for signups. You can simply improve this project by adding more public email domains and ensuring that no private domain is accidentally added to this list.</li>\n<li><strong><a href=\"https://github.com/LoginRadius/egnature\">Egnature</a>:</strong> This is a free and open source email signature generator. Contribute to this project, so anyone can easily set up their own email signature generator for their employees or community members.</li>\n<li><strong><a href=\"https://github.com/LoginRadius/ps-softlist\">PS Softlist</a>:</strong> This project offers a PowerShell script that helps you validate software installed on a Windows machine against a whitelist you create. This helps to perform software audits and generate relevant reports where compliance is essential. If you breathe PowerShell day in and day out, this is the project you can make a remarkable contribution to.</li>\n</ul>\n<p>Please note that each project will have specific guidelines on how to contribute in general and raise pull requests. Also, each project will have issues listed that you can pick and work on.</p>\n<p>If you’re facing any issues with locally running a project or something else, please feel free to raise an issue for the project. Our team will help you out.</p>\n<h2 id=\"win-loginradius-branded-swag\" style=\"position:relative;\"><a href=\"#win-loginradius-branded-swag\" aria-label=\"win loginradius branded swag permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Win LoginRadius Branded Swag</h2>\n<p>By actively participating in Hacktoberfest, you make the open source community more sustainable, and, in turn, this makes you feel at home. Empowering one another is what best depicts the open source philosophy and is a reward in itself.</p>\n<p>However, we want to make it more fun by sending cool t-shirts to all the accepted/eligible contributors. Just make sure to <a href=\"https://www.google.com/url?q=https://forms.gle/qhG6Sf8qrBznRrtQA&#x26;sa=D&#x26;source=editors&#x26;ust=1632314038203000&#x26;usg=AOvVaw3cOv-eOBvxNTaIS9j484fK\">fill this form</a> after you raise a pull request.</p>\n<p>Don’t forget that your contributions to our projects also count towards your overall Hacktoberfest contributions calculated by DigitalOcean — and if you’re eligible, they’ll send you another t-shirt as well.</p>\n<p>Let’s have fun with Hacktoberfest 2021!</p>\n<p><img src=\"https://media2.giphy.com/media/3oEjHKiDeYrKnjwGFq/giphy.gif\" alt=\"fun\"></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"September 23, 2021","updated_date":null,"title":"Hacktoberfest 2021: Contribute and Win Swag from LoginRadius","tags":["Hacktoberfest","Open Source","LoginRadius"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/b37804ed1ec767d9a9d9ed54872f51d5/58556/Hacktoberfest-2021.webp","srcSet":"/static/b37804ed1ec767d9a9d9ed54872f51d5/61e93/Hacktoberfest-2021.webp 200w,\n/static/b37804ed1ec767d9a9d9ed54872f51d5/1f5c5/Hacktoberfest-2021.webp 400w,\n/static/b37804ed1ec767d9a9d9ed54872f51d5/58556/Hacktoberfest-2021.webp 800w,\n/static/b37804ed1ec767d9a9d9ed54872f51d5/99238/Hacktoberfest-2021.webp 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Raghunath Reddy","github":"raghunath-r-a","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/loginradius-sponsorship-freecodecamp/"},"html":"<p>It is scientifically proven that helping others makes people happy. Probably no one knows this better than the developer community around the world, which continues to amaze by contributing extensively to free and open source software.</p>\n<p>And there is <a href=\"https://www.freecodecamp.org/\">freeCodeCamp</a> community, a nonprofit started in 2014 by <a href=\"https://twitter.com/ossia\">Quincy Larson</a>. It has been helping thousands of aspiring developers learn web development and find their first software jobs. The community features a self-paced learning platform that helps learn various web technologies, including Bootstrap, D3, jQuery, and React, among many others.</p>\n<p>Being a nonprofit, freeCodeCamp entirely works based on charitable donations and contributions of developers to maintain its learning platform. In fact, it is so efficient that with every $5 in donation, it can provide more than 250 hours of learning. And it is so effective that some of its alumni work for marquee tech companies like Apple, Google, Microsoft, and Amazon, among others.</p>\n<p>In 2013, just a year before freeCodeCamp was established, we founded LoginRadius with a vision to secure every identity on this planet. From our early beginnings, we have developed LoginRadius CIAM to empower developers to build more secure applications and simplify the implementation of customer identity and access management on their production applications to save development and maintenance time. Today, burgeoning startups to Fortune 500 companies trust LoginRadius, and we're now collectively handling 1.17 billion user identities for our customers worldwide.</p>\n<p>We are as obsessed as freeCodeCamp to support and enable the developer community to do much more and make this world a better place. And we wanted to continuously help the freeCodeCamp community in any way possible.</p>\n<p>Today, we are a <a href=\"https://www.freecodecamp.org/news/sponsors/\">proud sponsor</a> of freeCodeCamp and supporting the community's developers. </p>\n<p><a href=\"https://accounts.loginradius.com/auth.aspx?action=register\">Signup here</a> if you're a developer from the freeCodeCamp community. And we'll offer $200 credits so you can leverage LoginRadius CIAM — beyond the free developer tier — to implement highly secure, user-centric customer identity and access management.</p>\n<p>This is indeed a moment of joy and pride for everyone at LoginRadius. We would like to extend our gratitude to freeCodeCamp for letting us be a part of its journey in strengthening the developer community.</p>\n<p>By the way, if you want to share your expertise with the developer community, please feel free to write for the LoginRadius Blog portal. We have an open for contributions policy so anyone around the world can <a href=\"https://github.com/LoginRadius/engineering-portal/blob/master/CONTRIBUTING.md\">contribute</a>. Find more details on our public <a href=\"https://github.com/LoginRadius/engineering-portal\">GitHub repo</a>.</p>\n<p><img src=\"https://media.giphy.com/media/xUPGcGJJMFeAPhqrfi/giphy.gif\" alt=\"Squad Goals\"></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"July 16, 2021","updated_date":null,"title":"One Vision, Many Paths: How We’re Supporting freeCodeCamp","tags":["LoginRadius","sponsorship","freeCodeCamp"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.3333333333333333,"src":"/static/e2d9670f74a3203d6424fc773fbaf35b/58556/cover.webp","srcSet":"/static/e2d9670f74a3203d6424fc773fbaf35b/61e93/cover.webp 200w,\n/static/e2d9670f74a3203d6424fc773fbaf35b/1f5c5/cover.webp 400w,\n/static/e2d9670f74a3203d6424fc773fbaf35b/58556/cover.webp 800w,\n/static/e2d9670f74a3203d6424fc773fbaf35b/cc834/cover.webp 1024w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Raghunath Reddy","github":"raghunath-r-a","avatar":null}}}},{"node":{"fields":{"slug":"/identity/media-entertainment-use-loginradius-platform/"},"html":"<p>The Consumer Identity and Access Management or _CIAM _platform is rapidly becoming a ‘must have’ for any business focused on delivering a personalized experience to consumers. </p>\n<p>The entertainment industry is no different.</p>\n<p>Today, TV is no longer just the occasional evening in front of the telly. Streaming services, catch-up services, and OTT platforms mean we can watch whenever we want. </p>\n<p>The Global Media and Entertainment (M&#x26;E) industry is made up primarily of five distinct sub-segments– including TV, film, video games, publishing, and music.</p>\n<p>As such, it is one of the largest industries in the world when it comes to both revenue and market share.</p>\n<p>As the M&#x26;E industry continues to develop, a wave of new services, technology, and distribution methods continue to create more opportunities and challenges for production companies.</p>\n<p>It is critical to minimize the risk of data breaches and fraud that compromise confidential user information and not forget adherence to data privacy regulations. The balance between functionality and user experience is what separates the good from the great. </p>\n<p><a href=\"https://www.loginradius.com/blog/identity/2021/04/identity-management-in-media-industry/\">Identity sits at the core</a> of media digitalization. While there are many instances, here are five of the most common areas where the LoginRadius CIAM platform can provide a solution.</p>\n<h2 id=\"loginradius-ciam-capabilities-for-the-entertainment-industry\" style=\"position:relative;\"><a href=\"#loginradius-ciam-capabilities-for-the-entertainment-industry\" aria-label=\"loginradius ciam capabilities for the entertainment industry permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>LoginRadius’ CIAM Capabilities for the Entertainment Industry</h2>\n<h3 id=\"1-single-sign-on-sso\" style=\"position:relative;\"><a href=\"#1-single-sign-on-sso\" aria-label=\"1 single sign on sso permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. Single Sign On (SSO)</h3>\n<p>A single sign-on provides users with a convenient way to log in to multiple applications and/or websites without having to enter their user credentials repeatedly. It allows you to centralize your consumer records in a single location so you can easily track, share, and access all their information.</p>\n<ul>\n<li><strong>Web SSO</strong> is a browser-based SSO solution that operates through applications hosted on domains and subdomains. When a consumer moves from one domain to another within the same production house, the LoginRadius CIAM platform recognizes them, authenticates, and grants them access permission.</li>\n<li><strong>Mobile SSO</strong> operates through many mobile applications. If a consumer authenticates on one mobile app and then opens another operated by the same business, the CIAM platform recognizes the consumer. It grants access without requiring you to sign up or authenticate.</li>\n<li><strong><a href=\"https://www.loginradius.com/federated-sso/\">Federated SSO</a></strong> is a set of rules that can be implemented between two or more trusted domains to allow users to use the same digital identity to access applications and services.</li>\n</ul>\n<p><a href=\"https://www.loginradius.com/resource/federated-identity-management-datasheet\"><img src=\"/32a4bf3e0ff903411bf29faa6cb751c0/DS-Fed-IM.webp\" alt=\"DS-Fed-IM\"></a></p>\n<p>LoginRadius supports industry-standard SSO protocols like SAML, JWT, OAuth 2.0, OpenID Connect, and Web Services Federation.</p>\n<h3 id=\"2-authentication\" style=\"position:relative;\"><a href=\"#2-authentication\" aria-label=\"2 authentication permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. Authentication</h3>\n<p>The LoginRadius Identity Platform provides a comprehensive set of consumer registration and authentication options, allowing you to strike the right balance between convenience and security. You can choose from a range of options, including:</p>\n<ul>\n<li><strong>Passwordless Login</strong>: LoginRadius offers Passwordless Login with Magic Link or OTP to reduce unnecessary hassle during the registration and login processes. When a viewer clicks on the link or enters the OTP, LoginRadius creates an account, and the user is automatically logged in. </li>\n<li><strong>Smart Login</strong>: It is an effective way to log in for smart devices. Consumers can authenticate by scanning the QR Code displayed on the smart device using their mobile app or log in to an app by delegating the authentication to another device. </li>\n<li><strong>Social Login</strong>: With <a href=\"https://www.loginradius.com/resource/social-login-reconsidered/\">Social Login</a>, users can register and sign in using their existing accounts from various social media providers. It reduces the effort to remember a lot of passwords and makes authentication seamless. </li>\n<li><strong>2FA/MFA</strong>: Multi-Factor Authentication requires that users identify themselves with two different methods before they can access their accounts. This means you can be more confident that the person logging into your account is actually who they say they are.</li>\n<li><strong>Adaptive Authentication</strong>: Adaptive authentication is a method for choosing the right authentication factors based on a user's risk profile and tendencies – in other words, for adapting the form of authentication to the situation.</li>\n</ul>\n<h3 id=\"3-progressive-user-profiling\" style=\"position:relative;\"><a href=\"#3-progressive-user-profiling\" aria-label=\"3 progressive user profiling permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. Progressive User Profiling</h3>\n<p>Getting insights into your customers and their behavior patterns is vital to making sure you’re creating a personalized experience.</p>\n<p>The LoginRadius CIAM platform puts down the pieces of the puzzle of customer interactions and creates a holistic customer profile. We call it progressive user profiling. </p>\n<p>We don’t just identify who a person is. We identify who they are becoming. With this knowledge, you can create a 360-degree view of each individual to serve them content that builds long-term loyalty.</p>\n<h3 id=\"4-360-degree-consumer-view\" style=\"position:relative;\"><a href=\"#4-360-degree-consumer-view\" aria-label=\"4 360 degree consumer view permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>4. 360-Degree Consumer View</h3>\n<p>LoginRadius works through different applications, communicating with consumers and feeding a single image of them—regardless of which platform they're using.</p>\n<p>Why is this important? Because an identity layer and activity data across different systems will enable organizations to understand their consumers better and deliver personalized experiences.</p>\n<p>This means that marketing, sales, and support teams have real-time identity and behavior data to power customized interactions and control consent preferences through their systems.</p>\n<h3 id=\"5-consent-management\" style=\"position:relative;\"><a href=\"#5-consent-management\" aria-label=\"5 consent management permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>5. Consent Management</h3>\n<p>Regulations such as GDPR and the new California Consumer Privacy Act require businesses to know where and how to remove consumer data upon request, regardless of the channel from which the request is made.</p>\n<p>As a result, having a central consumer identity store that prioritizes first-party declared profile data and can integrate with <a href=\"https://www.loginradius.com/resource/loginradius-consent-management\">advanced consent management</a> software becomes critical to your compliance strategy.</p>\n<p>Moreover, in certain industries, such as entertainment, a CIAM platform is required to verify that users are who they claim they are, ensuring that the appropriate level of access is granted to the appropriate persons, fraudulent behavior is prevented, and identity data is collected with a high degree of certainty. </p>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>Every industry has a different set of identity challenges and a unique approach to identity management. When it comes to media and entertainment, viewers love to move around a lot. Therefore, organizations need to understand a few things before embarking on the journey. </p>\n<p>For example, what goal they hope to achieve, how does <a href=\"https://www.loginradius.com/resource/how-media-and-publication-companies-use-loginradius-identity-platform/\">a CIAM platform fits into the picture</a>, and identify the right solution to get the job done. LoginRadius allows you to equip and support your viewers well so you can adapt to the new way of entertainment. </p>\n<p><a href=\"https://www.loginradius.com/contact-us?utm_source=blog&#x26;utm_medium=web&#x26;utm_campaign=media-entertainment-use-loginradius-platform\"><img src=\"/788a6a84e389edac18728007099fdc1d/Book-a-free-demo-request-1024x310.webp\" alt=\"book-a-demo-loginradius\"></a></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"May 25, 2021","updated_date":null,"title":"How Entertainment Companies Use the LoginRadius CIAM platform","tags":["LoginRadius"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5151515151515151,"src":"/static/4559801deea09db3f388c50be7cd7366/58556/media-entertainment-use-loginradius-platform-cover.webp","srcSet":"/static/4559801deea09db3f388c50be7cd7366/61e93/media-entertainment-use-loginradius-platform-cover.webp 200w,\n/static/4559801deea09db3f388c50be7cd7366/1f5c5/media-entertainment-use-loginradius-platform-cover.webp 400w,\n/static/4559801deea09db3f388c50be7cd7366/58556/media-entertainment-use-loginradius-platform-cover.webp 800w,\n/static/4559801deea09db3f388c50be7cd7366/cc834/media-entertainment-use-loginradius-platform-cover.webp 1024w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Navanita Devi","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/identity/okta-acquires-auth0/"},"html":"<p>With COVID-19 forcing businesses of all sizes to move to remote working and connect with consumers online, Okta plans to leverage Auth0's consumer identification product to fuel growth in the $55 billion identity industry that splits as $25B for customer identity and $30B for workforce identity.</p>\n<p><em><strong>What does this acquisition imply, and why is it relevant?</strong></em></p>\n<p>For starters, this announcement reveals the dynamics of the historical and present-day scenario of the global consumer identity and access management (CIAM) market. Recent acquisition and investments show that a cloud-based customer identity platform to deliver secure digital experience and protect consumer privacy is gaining outrageous momentum.</p>\n<p>Here are some of the notable events in CIAM in recent times:</p>\n<ul>\n<li>In July 2020, Auth0 closed a <a href=\"https://www.globenewswire.com/news-release/2020/07/14/2062097/0/en/Auth0-Announces-120M-in-Series-F-Funding.html\">$120 million round of Series F funding</a>, which brought the company's valuation to $1.92 billion and total capital raised to more than $330 million.</li>\n<li>In September 2019, Denver security tech company <a href=\"https://www.bizjournals.com/denver/news/2019/09/19/denver-security-tech-company-goes-public-with-more.html#:~:text=Denver%20security%20tech%20company%20goes%20public%2C%20with%20more%20than%20%241B%20valuation&#x26;text=Denver%2Dbased%20security%20tech%20company,stock%20at%20%2415%20per%20share.\">Ping Identity went public</a> with more than $1B valuation.</li>\n<li>In January 2019, the Akamai Intelligent Edge Platform <a href=\"https://www.prnewswire.com/news-releases/akamai-completes-acquisition-of-customer-identity-access-management-company-janrain-inc-300783209.html\">acquired Janrain</a> to provide a highly-secure and resilient identity management environment for businesses and their customers.</li>\n<li>In July 2018, cloud-based CIAM platform LoginRadius announced <a href=\"https://www.loginradius.com/blog/identity/loginradius-announces-17m-series-funding-forgepoint-microsoft/\">$17M Series A Funding</a> from Microsoft's Venture Fund to accelerate its product innovation.</li>\n<li>In November 2017, SAP completed the acquisition of customer identity management firm Gigya for $350M in a smart move to strengthen its Hybris e-commerce division.</li>\n<li>In June 2016, Vista Equity Partners acquired <a href=\"https://www.pingidentity.com/en/company/press-releases-folder/2016/vista-equity-partners-to-acquire-ping-identity.html\">majority ownership of Ping Identity</a> in a leveraged buyout for $600 million.</li>\n</ul>\n<p>There were no pure-play CIAM vendors a decade ago and big players such as IBM, Oracle, Microsoft tried to extend their Employee IAM offering to customer identity use cases (which did not work). However, the newer players like Auth0, Gigya, ForgeRock, and LoginRadius have more recently driven innovation and accelerated adoption of Customer IAM technology. There's no doubt that identity is taking over as a strategic imperative for winning big in the digital economy.</p>\n<p><strong>Why are businesses investing like never before?</strong></p>\n<p>With massive penetration of smartphones, Internet and cloud, the world has gone digital and consumers expect everything online. Especially in this pandemic period, consumers have become increasingly reliant on online purchases.</p>\n<p>Brands have no choice but to build frictionless and secure digital experience for their customers while protecting their privacy. Consumers expect to access most of the services via a variety of devices and web applications, prompting businesses to invest in advanced technology that prevents cybercriminals from gaining access to sensitive information. Among security requirements include global compliances like the GDPR and CCPA. Customer IAM is emerging as foundational technology.</p>\n<p>Even analysts firms like Forrester, Gartner and KuppingerCole reported about this new and exciting category, where <a href=\"https://yaletown.com/news/loginradius-named-top-vendor-gartner-forrester/\">LoginRadius</a> has been emerging as a leading vendor, time and again. In the recent <a href=\"https://www.forrester.com/report/The+Forrester+Wave+Customer+Identity+And+Access+Management+Q4+2020/-/E-RES159083\">Forrester Wave on CIAM</a>, LoginRadius’ technology was ranked #1 above Auth0 and Okta.</p>\n<p><strong>What does the future look like?</strong></p>\n<p>Current CIAM players represent the tip of the iceberg of $25B revenue opportunity in Customer IAM space. My estimate is that less than 1.5% of this revenue opportunity is tapped so far. More importantly, the total addressable market is growing exponentially as the world gets digitized.</p>\n<p>This is an exciting phase of the IAM space particularly for the new category, Customer IAM (CIAM).</p>\n<p>I see three key trends emerging in coming years:</p>\n<ul>\n<li>Organizations stop building and maintaining customer identity systems in-house rather purchasing a cloud-based CIAM platform to save on massive spending and get faster time-to-value.</li>\n<li>In post-COVID world, the consumer-facing digital transformation will drive massive demand for CIAM.</li>\n<li>As Okta CEO Todd McKinnon said, the identity is becoming a first-class cloud category alongside infrastructure, a collaboration of enterprise software, and others.</li>\n</ul>\n<p>I’m excited for all the CIAM players.</p>\n<p>Together, let's build a world which is more secure, where privacy is protected and where consumers have delighted digital experience.</p>\n<p><a href=\"https://www.loginradius.com/contact-us?utm_source=blog&#x26;utm_medium=web&#x26;utm_campaign=okta-acquires-auth0\"><img src=\"/8fce571f703a5970dbb1359a2fe0e51a/book-a-demo-loginradius.webp\" alt=\"book-a-free-demo-loginradius\"></a></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"March 04, 2021","updated_date":null,"title":"CIAM Continues to Draw Attention as Okta acquires Auth0","tags":["LoginRadius"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":0.8,"src":"/static/9ba0a1dc94fe524d0ff0fcb19d33e694/3b245/loginradius-blog.webp","srcSet":"/static/9ba0a1dc94fe524d0ff0fcb19d33e694/61e93/loginradius-blog.webp 200w,\n/static/9ba0a1dc94fe524d0ff0fcb19d33e694/1f5c5/loginradius-blog.webp 400w,\n/static/9ba0a1dc94fe524d0ff0fcb19d33e694/3b245/loginradius-blog.webp 701w","sizes":"(max-width: 701px) 100vw, 701px"}}},"author":{"id":"Rakesh Soni","github":"oyesoni","avatar":"rakesh-soni.webp"}}}},{"node":{"fields":{"slug":"/engineering/electronic-identity-integration/"},"html":"<p>E-commerce business is growing day by day as it saves time and cost for people traveling to meet or perform businesses in person. More people are conducting business online by creating accounts using email or phone verification. This has posed a challenge for everyone to identify the persons who we are claiming online. Online hackers have used false Identity to deceive or defraud someone else. Hence, Electronic Identity ( eID) provides a way for businesses to verify a person's identity online and reduce the chances of Identity Fraud.</p>\n<h2 id=\"what-is-an-electronic-identity\" style=\"position:relative;\"><a href=\"#what-is-an-electronic-identity\" aria-label=\"what is an electronic identity permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is an electronic identity?</h2>\n<p>Electronic identity is an electronic card or device with a unique identity number issued by either a government agency or some banks. A consumer needs to go to the government agency or some banks and show valid identity documents. After the document verification, an Electronic Identity is issued to the consumer. Examples of e-IDs are Danish NemID, Swedish BankID, and Dutch DigiD.</p>\n<p>Most service providers such as financial institutions and insurance firms provide services online and are recognizing an opportunity in implementing eID due to strict Know Your Customer (KYC) and Anti-Money Laundering (AML) requirements.</p>\n<p>eIDs are used to authenticate consumers online across multiple platforms and services. eIDs also allow the consumers to sign documents online, and the companies can trust the signature as the electronic identity is issued by the government or banks based on physical identity documents. This is fast, convenient, and secure for the consumers as they are saved from completing registration forms for multiple services. Hence, this increases the conversion for the businesses. </p>\n<h2 id=\"integrating-eid-authentication-with-loginradius\" style=\"position:relative;\"><a href=\"#integrating-eid-authentication-with-loginradius\" aria-label=\"integrating eid authentication with loginradius permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Integrating eID authentication with LoginRadius</h2>\n<p>LoginRadius supports all the major industry federated SSO methods. Hence, you can integrate eID authentication with LoginRadius using some third application like Criipto, which supports the industry-standard SSO methods. Criipto allows the integration of an eID with the LoginRadius application using JWT SSO Login flow.  Jason Web Token ( JWT) is a signed token that transfers the information from one service to another securely. </p>\n<h3 id=\"prerequisite\" style=\"position:relative;\"><a href=\"#prerequisite\" aria-label=\"prerequisite permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Prerequisite</h3>\n<ul>\n<li>A Criipto account ( you can create a free trial account )</li>\n<li>A LoginRadius application </li>\n<li>One of the desired electronic ID</li>\n</ul>\n<h3 id=\"register-your-loginradius-app-in-your-criipto-account\" style=\"position:relative;\"><a href=\"#register-your-loginradius-app-in-your-criipto-account\" aria-label=\"register your loginradius app in your criipto account permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Register your LoginRadius app in your Criipto account</h3>\n<hr>\n<p>Please see the following steps to register your LoginRadius app in your Criipto account.</p>\n<ol>\n<li>Login in to your <a href=\"https://manage.criipto.id/login\">Criipto account</a>.</li>\n<li>Click + sign to add an application under the Applications tab.</li>\n<li>\n<p>Add the following information:\n<img src=\"/3791e451e2ca605de23570e590ae2e39/criipto-config1.webp\" alt=\"criipto config\"></p>\n<ul>\n<li>Name: Enter a name to identify your app in the Criipto.</li>\n<li>Domain: choose an available domain</li>\n<li>Callback URLs: Enter https://<LR appname>.hub.loginradius.com/access/jwt\n<img src=\"/d7a33776d082102bdca579cd9b35966f/criipto-config2.webp\" alt=\"criipto config\"></li>\n<li>Enable the desired eIDs</li>\n<li>Enable the <strong>Enable OAuth2 Code Flow</strong> under <strong>OpenID Connect</strong></li>\n<li>Click the Re-generate client secret button to generate a client secret. </li>\n<li>Select <strong>SignedJwt</strong> under <strong>User info response strategy</strong> </li>\n<li>Select <strong>compact</strong> under <strong>JWT property format</strong></li>\n<li>Enter the desired token time in <strong>Token lifetime</strong> under <strong>Advanced Options</strong>.</li>\n</ul>\n</li>\n<li>Click the <strong>save</strong> button.</li>\n</ol>\n<h3 id=\"configure-the-criipto-settings-in-the-loginradius\" style=\"position:relative;\"><a href=\"#configure-the-criipto-settings-in-the-loginradius\" aria-label=\"configure the criipto settings in the loginradius permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Configure the Criipto settings in the LoginRadius</h3>\n<ol>\n<li>Login into the <a href=\"https://adminconsole.loginradius.com/\">Admin Console</a></li>\n<li>Navigate to Platform Configuration>Authentication Configuration>Custom IDPs>JWT Provider\n<img src=\"/08f84d337d1d3fc37302043e1e940987/LR-JWT-Config1.webp\" alt=\"JWT config\"></li>\n<li>Click <strong>+ Add A New Provider</strong> button highlighted on the above screen, and the following JWT configuration form fields will appear:\n<img src=\"/b49eb762379da71ae766c76ec1a26497/LR-JWT-Config2.webp\" alt=\"JWT config\"></li>\n<li>\n<p>Complete the following details in the JWT provider</p>\n<ul>\n<li>Enter a unique name under the <strong>Provider Name</strong>. This name will be displayed under the social login forms in the LoginRadius IDX page and on the social login form rendered by LoginRadius V2.js library on your application if the Include In Social Schema is selected while configuring the JWT app.</li>\n<li>Select RS256 under the JWT signing <strong>Algorithm</strong> used by your application ( the selected algorithm is used in encrypting your consumers' information in the JWT).</li>\n<li>Enter the JWT secret or certificate (depending on the chosen algorithm) in the <strong>Key</strong> text box.</li>\n<li>Clock Skew(Optional): Enter 0</li>\n<li>Expiration Time Difference (Optional): Enter 0</li>\n<li>Token Query Parameter Name (Optional): Enter id_token</li>\n<li>\n<p>Data Mapping:</p>\n<ul>\n<li>Select Field(Dropdown): Select the LoginRadius field ID field</li>\n<li>Profile Key: Enter the user identifier field name from the JWT ( please see <a href=\"https://docs.criipto.com/getting-started/token-contents/\">Token contents</a> for the JWT payload returned by an eID)</li>\n</ul>\n</li>\n<li>Enable Include In Social Schema</li>\n</ul>\n</li>\n<li>Click the <strong>Add</strong> button </li>\n</ol>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"January 29, 2021","updated_date":null,"title":"Integration with electronic identity (eID) ","tags":["Electronic Identity","Bank ID","Criipto","LoginRadius"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/b916d567b9e41b342cccd7613d625bf6/8829b/Integration_with_eID.webp","srcSet":"/static/b916d567b9e41b342cccd7613d625bf6/61e93/Integration_with_eID.webp 200w,\n/static/b916d567b9e41b342cccd7613d625bf6/1f5c5/Integration_with_eID.webp 400w,\n/static/b916d567b9e41b342cccd7613d625bf6/8829b/Integration_with_eID.webp 680w","sizes":"(max-width: 680px) 100vw, 680px"}}},"author":{"id":"Jitender Agarwal","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/user-authentication-react-application/"},"html":"<p>This guide uses LoginRadius API for authenticating React apps. It provides React developers with a more straightforward way to add user authentication to react apps. To handle a lot of authentication implementation information, LoginRadius offers a high-level API. Using security best practices, now you can protect your response apps while writing less code.</p>\n<p>This article <a href=\"/react-hooks-guide/\">focuses on helping developers</a> learn how to integrate user authentication in the React application. Practice the following security principles to improve authentication on React applications:</p>\n<ul>\n<li>Add user login and user login.</li>\n<li>User information retrieval.</li>\n<li>Attach a tab for sign-up.</li>\n</ul>\n<p>In the React application, we can <a href=\"/react-context-api/\">easily and quickly</a> add authentication by using LoginRadius. If you already have a customized login/registration page ready, then I'll guide you to the next step of adding authentication in react apps.</p>\n<h2 id=\"configure-loginradius-for-react-application\" style=\"position:relative;\"><a href=\"#configure-loginradius-for-react-application\" aria-label=\"configure loginradius for react application permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Configure LoginRadius for React Application</h2>\n<p>A new application was created for you when you <a href=\"https://accounts.loginradius.com/auth.aspx?action=register&#x26;return_url=https://dashboard.loginradius.com/login\">signed up</a> for LoginRadius. From here, you get some essential information.</p>\n<ol>\n<li>API Key  <a href=\"https://www.loginradius.com/developers/\">How to get API Key?</a></li>\n<li>Sott  <a href=\"https://www.loginradius.com/developers/\">Work with Sott</a></li>\n</ol>\n<h2 id=\"add-following-loginradius-js-library-into-your-application\" style=\"position:relative;\"><a href=\"#add-following-loginradius-js-library-into-your-application\" aria-label=\"add following loginradius js library into your application permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Add following LoginRadius JS library into your application</h2>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">&lt;script type=&quot;text/javascript&quot; src=&quot;https://auth.lrcontent.com/v2/LoginRadiusV2.js&quot;&gt;&lt;/script&gt;</span></code></pre>\n<h2 id=\"add-authentication-when-you-have-customized-login-page\" style=\"position:relative;\"><a href=\"#add-authentication-when-you-have-customized-login-page\" aria-label=\"add authentication when you have customized login page permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Add Authentication when you have customized Login Page</h2>\n<h3 id=\"add-login-to-your-react-application\" style=\"position:relative;\"><a href=\"#add-login-to-your-react-application\" aria-label=\"add login to your react application permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Add Login to your react application</h3>\n<p>We will use an API framework to call LoginRadius APIs for authentication.  Create a new file <strong>LoginPage.js</strong>, and add the following code.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">import</span><span class=\"mtk1\">  </span><span class=\"mtk12\">React</span><span class=\"mtk1\">, { </span><span class=\"mtk12\">useState</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\">  </span><span class=\"mtk8\">&quot;react&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">const</span><span class=\"mtk1\">  </span><span class=\"mtk12\">lrconfig</span><span class=\"mtk1\"> = {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">apiKey:</span><span class=\"mtk1\">  </span><span class=\"mtk8\">&quot;*************************&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk3\">//LoginRadius API key</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    };</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">const</span><span class=\"mtk1\">  </span><span class=\"mtk12\">loginradius</span><span class=\"mtk1\"> = {};</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">window</span><span class=\"mtk1\">.</span><span class=\"mtk12\">LoginRadiusV2</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">loginradius</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">new</span><span class=\"mtk1\">  </span><span class=\"mtk10\">window</span><span class=\"mtk1\">.</span><span class=\"mtk10\">LoginRadiusV2</span><span class=\"mtk1\">(</span><span class=\"mtk12\">lrconfig</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">loginradius</span><span class=\"mtk1\">.</span><span class=\"mtk12\">api</span><span class=\"mtk1\">.</span><span class=\"mtk11\">init</span><span class=\"mtk1\">(</span><span class=\"mtk12\">lrconfig</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">const</span><span class=\"mtk1\">  </span><span class=\"mtk11\">LoginButton</span><span class=\"mtk1\"> = () </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk4\">const</span><span class=\"mtk1\">  </span><span class=\"mtk11\">loginButtonHandler</span><span class=\"mtk1\"> = () </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">loginradius</span><span class=\"mtk1\">.</span><span class=\"mtk12\">api</span><span class=\"mtk1\">.</span><span class=\"mtk11\">login</span><span class=\"mtk1\">({</span><span class=\"mtk12\">emailid:</span><span class=\"mtk1\">  </span><span class=\"mtk12\">emailValue</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">password:</span><span class=\"mtk1\">  </span><span class=\"mtk12\">passwordValue</span><span class=\"mtk1\">},</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      (</span><span class=\"mtk12\">successResponse</span><span class=\"mtk1\">)</span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk3\">//Here you will get the access Token of </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">successResponse</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      (</span><span class=\"mtk12\">errors</span><span class=\"mtk1\">) </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">errors</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      });</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> [</span><span class=\"mtk12\">emailValue</span><span class=\"mtk1\">, </span><span class=\"mtk12\">updateEmailValue</span><span class=\"mtk1\">] = </span><span class=\"mtk11\">useState</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> [</span><span class=\"mtk12\">passwordValue</span><span class=\"mtk1\">, </span><span class=\"mtk12\">updatePasswordValue</span><span class=\"mtk1\">] = </span><span class=\"mtk11\">useState</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">React.Fragment</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span><span class=\"mtk1\">  </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;text&quot;</span><span class=\"mtk1\">  </span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk12\">emailValue</span><span class=\"mtk4\">}</span><span class=\"mtk1\">  </span><span class=\"mtk12\">onChange</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk1\">(</span><span class=\"mtk12\">e</span><span class=\"mtk1\">)</span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\">{</span><span class=\"mtk11\">updateEmailValue</span><span class=\"mtk1\">(</span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk12\">target</span><span class=\"mtk1\">.</span><span class=\"mtk12\">value</span><span class=\"mtk1\">)}</span><span class=\"mtk4\">}</span><span class=\"mtk1\">  </span><span class=\"mtk12\">placeholder</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk8\">&quot;email&quot;</span><span class=\"mtk4\">}</span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span><span class=\"mtk1\">  </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;password&quot;</span><span class=\"mtk1\">  </span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk12\">passwordValue</span><span class=\"mtk4\">}</span><span class=\"mtk1\">  </span><span class=\"mtk12\">onChange</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk1\">(</span><span class=\"mtk12\">e</span><span class=\"mtk1\">)</span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\">{</span><span class=\"mtk11\">updatePasswordValue</span><span class=\"mtk1\">(</span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk12\">target</span><span class=\"mtk1\">.</span><span class=\"mtk12\">value</span><span class=\"mtk1\">)}</span><span class=\"mtk4\">}</span><span class=\"mtk1\">  </span><span class=\"mtk12\">placeholder</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk8\">&quot;Password&quot;</span><span class=\"mtk4\">}</span><span class=\"mtk1\">  </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">button</span><span class=\"mtk1\">  </span><span class=\"mtk12\">onClick</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk1\">() </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\">  </span><span class=\"mtk11\">loginButtonHandler</span><span class=\"mtk1\">()</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Log In</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">button</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">React.Fragment</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      );</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      };</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk15\">export</span><span class=\"mtk1\">  </span><span class=\"mtk15\">default</span><span class=\"mtk1\">  </span><span class=\"mtk12\">LoginButton</span><span class=\"mtk1\">;</span></span></code></pre>\n<p>In the above code, you will see the <code>lrConfig</code> object, which has apikey that you will get from the LoginRadius account. After calling <code>loginradius.api.login</code>, you will get the response in which you will get the access Token. Through this access token, you can get the user profile.</p>\n<h3 id=\"add-logout-to-your-react-application\" style=\"position:relative;\"><a href=\"#add-logout-to-your-react-application\" aria-label=\"add logout to your react application permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Add Logout to your react application</h3>\n<p>Create <strong>LogoutPage.js</strong> file and add following code:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">import</span><span class=\"mtk1\"> </span><span class=\"mtk12\">React</span><span class=\"mtk1\">, { </span><span class=\"mtk12\">useState</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;react&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">lrconfig</span><span class=\"mtk1\"> = {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">apiKey:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;*************************&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk3\">//LoginRadius API key</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    };</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">loginradius</span><span class=\"mtk1\"> = {};</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">window</span><span class=\"mtk1\">.</span><span class=\"mtk12\">LoginRadiusV2</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">loginradius</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">window</span><span class=\"mtk1\">.</span><span class=\"mtk10\">LoginRadiusV2</span><span class=\"mtk1\">(</span><span class=\"mtk12\">lrconfig</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">loginradius</span><span class=\"mtk1\">.</span><span class=\"mtk12\">api</span><span class=\"mtk1\">.</span><span class=\"mtk11\">init</span><span class=\"mtk1\">(</span><span class=\"mtk12\">lrconfig</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">LogoutButton</span><span class=\"mtk1\"> = () </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">token</span><span class=\"mtk1\">  = </span><span class=\"mtk8\">&#39;************&#39;</span><span class=\"mtk1\">; </span><span class=\"mtk3\">// Access Token that you got after login</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">logoutButtonHandler</span><span class=\"mtk1\"> = () </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk3\">//Note: Call invalidate token api to invalidate the token.**</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">loginradius</span><span class=\"mtk1\">.</span><span class=\"mtk12\">api</span><span class=\"mtk1\">.</span><span class=\"mtk11\">invalidateToken</span><span class=\"mtk1\">(</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">               </span><span class=\"mtk12\">token</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">               (</span><span class=\"mtk12\">successResponse</span><span class=\"mtk1\">)</span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">           </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">successResponse</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">           },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">               (</span><span class=\"mtk12\">errors</span><span class=\"mtk1\">) </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                 </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">errors</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">               }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">             );</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">       }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">React.Fragment</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">       </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">button</span><span class=\"mtk1\"> </span><span class=\"mtk12\">onClick</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk1\">() </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk11\">logoutButtonHandler</span><span class=\"mtk1\">()</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Logout</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">button</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">       </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">React.Fragment</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">       );</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    };</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk15\">default</span><span class=\"mtk1\"> </span><span class=\"mtk12\">LogoutButton</span><span class=\"mtk1\">;</span></span></code></pre>\n<p>In the above code, we have called invalidated token api, which expires your access token.</p>\n<h3 id=\"add-signup-to-your-react-application\" style=\"position:relative;\"><a href=\"#add-signup-to-your-react-application\" aria-label=\"add signup to your react application permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Add Signup to your react application</h3>\n<p>Create <strong>SignupPage.js</strong> file and add the following code:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">import</span><span class=\"mtk1\">  </span><span class=\"mtk12\">React</span><span class=\"mtk1\">, { </span><span class=\"mtk12\">useState</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\">  </span><span class=\"mtk8\">&quot;react&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">const</span><span class=\"mtk1\">  </span><span class=\"mtk12\">lrconfig</span><span class=\"mtk1\"> = {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">apiKey:</span><span class=\"mtk1\">  </span><span class=\"mtk8\">&quot;*************************&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk3\">//LoginRadius API key</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">sott:</span><span class=\"mtk1\">  </span><span class=\"mtk8\">&quot;***************************&quot;</span><span class=\"mtk1\">  </span><span class=\"mtk3\">//Secure Token for signup functionality</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    };</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">const</span><span class=\"mtk1\">  </span><span class=\"mtk12\">loginradius</span><span class=\"mtk1\"> = {};</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">window</span><span class=\"mtk1\">.</span><span class=\"mtk12\">LoginRadiusV2</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">loginradius</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">new</span><span class=\"mtk1\">  </span><span class=\"mtk10\">window</span><span class=\"mtk1\">.</span><span class=\"mtk10\">LoginRadiusV2</span><span class=\"mtk1\">(</span><span class=\"mtk12\">lrconfig</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">loginradius</span><span class=\"mtk1\">.</span><span class=\"mtk12\">api</span><span class=\"mtk1\">.</span><span class=\"mtk11\">init</span><span class=\"mtk1\">(</span><span class=\"mtk12\">lrconfig</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">const</span><span class=\"mtk1\">  </span><span class=\"mtk11\">SignupButton</span><span class=\"mtk1\"> = () </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk4\">const</span><span class=\"mtk1\">  </span><span class=\"mtk11\">signupButtonHandler</span><span class=\"mtk1\"> = () </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">loginradius</span><span class=\"mtk1\">.</span><span class=\"mtk12\">api</span><span class=\"mtk1\">.</span><span class=\"mtk11\">registration</span><span class=\"mtk1\">({</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">email:</span><span class=\"mtk1\"> [{ </span><span class=\"mtk12\">type:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Primary&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">value:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">emailValue</span><span class=\"mtk1\"> }],</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">              </span><span class=\"mtk12\">password:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">passwordValue</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      (</span><span class=\"mtk12\">successResponse</span><span class=\"mtk1\">)</span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk3\">//Here you will get the response after registration</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">successResponse</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      (</span><span class=\"mtk12\">errors</span><span class=\"mtk1\">) </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">errors</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      });</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> [</span><span class=\"mtk12\">emailValue</span><span class=\"mtk1\">, </span><span class=\"mtk12\">updateEmailValue</span><span class=\"mtk1\">] = </span><span class=\"mtk11\">useState</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> [</span><span class=\"mtk12\">passwordValue</span><span class=\"mtk1\">, </span><span class=\"mtk12\">updatePasswordValue</span><span class=\"mtk1\">] = </span><span class=\"mtk11\">useState</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">React.Fragment</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span><span class=\"mtk1\">  </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;text&quot;</span><span class=\"mtk1\">  </span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk12\">emailValue</span><span class=\"mtk4\">}</span><span class=\"mtk1\">  </span><span class=\"mtk12\">onChange</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk1\">(</span><span class=\"mtk12\">e</span><span class=\"mtk1\">)</span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\">{</span><span class=\"mtk11\">updateEmailValue</span><span class=\"mtk1\">(</span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk12\">target</span><span class=\"mtk1\">.</span><span class=\"mtk12\">value</span><span class=\"mtk1\">)}</span><span class=\"mtk4\">}</span><span class=\"mtk1\">  </span><span class=\"mtk12\">placeholder</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk8\">&quot;email&quot;</span><span class=\"mtk4\">}</span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span><span class=\"mtk1\">  </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;password&quot;</span><span class=\"mtk1\">  </span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk12\">passwordValue</span><span class=\"mtk4\">}</span><span class=\"mtk1\">  </span><span class=\"mtk12\">onChange</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk1\">(</span><span class=\"mtk12\">e</span><span class=\"mtk1\">)</span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\">{</span><span class=\"mtk11\">updatePasswordValue</span><span class=\"mtk1\">(</span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk12\">target</span><span class=\"mtk1\">.</span><span class=\"mtk12\">value</span><span class=\"mtk1\">)}</span><span class=\"mtk4\">}</span><span class=\"mtk1\">  </span><span class=\"mtk12\">placeholder</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk8\">&quot;Password&quot;</span><span class=\"mtk4\">}</span><span class=\"mtk1\">  </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">button</span><span class=\"mtk1\">  </span><span class=\"mtk12\">onClick</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk1\">() </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\">  </span><span class=\"mtk11\">signupButtonHandler</span><span class=\"mtk1\">()</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Log In</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">button</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">React.Fragment</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      );</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      };</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk15\">export</span><span class=\"mtk1\">  </span><span class=\"mtk15\">default</span><span class=\"mtk1\">  </span><span class=\"mtk12\">SignupButton</span><span class=\"mtk1\">;</span></span></code></pre>\n<p>In the above code, You will get a success/error response after calling the registration api.</p>\n<h2 id=\"wrap-up\" style=\"position:relative;\"><a href=\"#wrap-up\" aria-label=\"wrap up permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Wrap up</h2>\n<p>The most common authentication use case for a React application gets covered in this tutorial: quick login and logout. However, LoginRadius is an expandable and versatile platform that can help you accomplish much more. In this guide, We have used the LoginRadius API Framework. If you want to incorporate our hosted page into your application, follow this <a href=\"https://www.loginradius.com/developers/\">documentation</a>.</p>\n<p>Let me know what you think of this tutorial in the comments below. Thanks for reading :)</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk17 { color: #808080; }\n</style>","frontmatter":{"date":"December 10, 2020","updated_date":null,"title":"A Guide To React User Authentication with LoginRadius","tags":["Authentication","LoginRadius","React"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/a877f5fa04ac6dd24b63bb101cc8302d/58556/authentication-main.webp","srcSet":"/static/a877f5fa04ac6dd24b63bb101cc8302d/61e93/authentication-main.webp 200w,\n/static/a877f5fa04ac6dd24b63bb101cc8302d/1f5c5/authentication-main.webp 400w,\n/static/a877f5fa04ac6dd24b63bb101cc8302d/58556/authentication-main.webp 800w,\n/static/a877f5fa04ac6dd24b63bb101cc8302d/99238/authentication-main.webp 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Versha Gupta","github":"vershagupta","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/loginradius-opensource-repos-for-hacktoberfest-2020/"},"html":"<h2 id=\"loginradius-open-source-projects\" style=\"position:relative;\"><a href=\"#loginradius-open-source-projects\" aria-label=\"loginradius open source projects permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>LoginRadius Open Source Projects</h2>\n<p>Just 1 week left in hacktoberfest 2020 and being part of it, we at LoginRadius are all set with lots of our projects going open source this year.</p>\n<blockquote>\n<p>To get LoginRadius swags see our <a href=\"/loginradius-supports-hacktoberfest-2020/\">Hacktoberfest Launch Blog</a>. We have around <strong>500</strong> swags for our open source contributors.</p>\n</blockquote>\n<p><strong>Here is a list of our open source projects available on Github for hacktoberfest 2020</strong></p>\n<p><img src=\"/02fcd3f81a4a4130403e1ae6713b83f8/lr-open-source.webp\" alt=\"loginradius-hacktoberfest\"></p>\n<ul>\n<li>\n<p><a href=\"https://github.com/LoginRadius/engineering-portal\">LoginRadius Engineering Portal</a></p>\n<ul>\n<li>Our Engineering Blog where you can contribute by writing a guest blog of fixing any issue you find with any of the available blogs.</li>\n</ul>\n</li>\n<li>\n<p><a href=\"https://github.com/LoginRadius/docs\">LoginRadius Docs</a></p>\n<ul>\n<li>LoginRadius Developer Documentation</li>\n</ul>\n</li>\n<li>\n<p><a href=\"https://github.com/LoginRadius/egnature\">Egnature</a></p>\n<ul>\n<li>An another email signature generator</li>\n</ul>\n</li>\n<li>\n<p>Cascade</p>\n<ul>\n<li>Create your internal developers' portal using Cascade.</li>\n</ul>\n</li>\n<li>\n<p><a href=\"https://github.com/LoginRadius/csharp-password-hash\">C# Password Hash Library</a></p>\n<ul>\n<li>.NET standard library to secure the passwords using multiple hashing algorithms.</li>\n</ul>\n</li>\n<li>\n<p><a href=\"https://github.com/LoginRadius/go-saml\">Go-SAML</a></p>\n<ul>\n<li>High-Level API Implementation of SAML 2.0 (Currently Supported Identity Provider Implementation) Single Sign-On</li>\n</ul>\n</li>\n<li>\n<p><a href=\"https://github.com/LoginRadius/ps-softlist\">PS-Softlist</a></p>\n<ul>\n<li>A power shell script to detect non-whitelisted installed software on Windows machines.</li>\n</ul>\n</li>\n</ul>\n<blockquote>\n<p>Check the open issues on each of the projects as well as Pull Request before creating a new one. Happy Coding!\nStay tuned for more updates from LoginRadius and don't forget to check our Hacktoberfest Page to get around <strong>500 swags</strong> from LoginRadius.</p>\n</blockquote>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"September 25, 2020","updated_date":null,"title":"LoginRadius Open Source For Hacktoberfest 2020","tags":["hacktoberfest","open-source","LoginRadius"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5873015873015872,"src":"/static/9a2056972f92077b2af8b32ecc2fcbdd/58556/hacktober-fest-banner.webp","srcSet":"/static/9a2056972f92077b2af8b32ecc2fcbdd/61e93/hacktober-fest-banner.webp 200w,\n/static/9a2056972f92077b2af8b32ecc2fcbdd/1f5c5/hacktober-fest-banner.webp 400w,\n/static/9a2056972f92077b2af8b32ecc2fcbdd/58556/hacktober-fest-banner.webp 800w,\n/static/9a2056972f92077b2af8b32ecc2fcbdd/e30b5/hacktober-fest-banner.webp 1000w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Hridayesh Sharma","github":"vyasriday","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/loginradius-supports-hacktoberfest-2020/"},"html":"<h2 id=\"have-you-ever-thought-about-what-the-world-would-be-like-if-open-source-didnt-exist\" style=\"position:relative;\"><a href=\"#have-you-ever-thought-about-what-the-world-would-be-like-if-open-source-didnt-exist\" aria-label=\"have you ever thought about what the world would be like if open source didnt exist permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Have you ever thought about what the world would be like if open-source didn't exist?</h2>\n<p>It's hard to imagine a world without open source these days. Open source powers the biggest organizations of today's world. Open-source software like <a href=\"https://en.wikipedia.org/wiki/Linux\">Linux</a> runs most of today's servers and also powers the <a href=\"https://en.wikipedia.org/wiki/Android_(operating_system)\">Android Operating System</a>.</p>\n<h2 id=\"introducing-hacktoberfest-2020\" style=\"position:relative;\"><a href=\"#introducing-hacktoberfest-2020\" aria-label=\"introducing hacktoberfest 2020 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Introducing Hacktoberfest 2020</h2>\n<h4 id=\"in-a-gist-hacktoberfest-is-a-festival-of-giving-back-to-the-community\" style=\"position:relative;\"><a href=\"#in-a-gist-hacktoberfest-is-a-festival-of-giving-back-to-the-community\" aria-label=\"in a gist hacktoberfest is a festival of giving back to the community permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>In a gist hacktoberfest is a festival of \"giving back to the community\".</h4>\n<p>Hacktoberfest is a month-long celebration of open-source software in October month run by DigitalOcean in partnership with GitHub and DEV. Hacktoberfest is open to everyone in our global community!</p>\n<p><strong>From Official Website:</strong></p>\n<blockquote>\n<p>Hacktoberfest is open to everyone in our global community. Whether you’re new to development, a student, long-time contributor, event host, or company of any size, you can help drive the growth of open source and make positive contributions to an ever-growing community. All backgrounds and skill levels are encouraged to complete the challenge.</p>\n</blockquote>\n<p>The purpose of this month-long celebration is to get people started in open source and give back to the open-source community.</p>\n<p>It is the easiest way to get into open source for people who have never contributed to open-source community or find it difficult to contribute.</p>\n<h3 id=\"how-to-contribute-to-hacktoberfest\" style=\"position:relative;\"><a href=\"#how-to-contribute-to-hacktoberfest\" aria-label=\"how to contribute to hacktoberfest permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How to contribute to Hacktoberfest?</h3>\n<p>Anyone can contribute to hacktoberfest by registering at <a href=\"https://hacktoberfest.digitalocean.com/\">hacktoberfest website</a> anytime between 1st October to 31st October.</p>\n<p>During this time, anyone who wishes to be part of this month-long fest needs to open four quality pull requests on any of the open-source projects on Github.</p>\n<h3 id=\"how-to-find-projects\" style=\"position:relative;\"><a href=\"#how-to-find-projects\" aria-label=\"how to find projects permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How to find Projects?</h3>\n<p>Finding projects can be a bit challenging. It can be the tools you are already using, or different tools can be used to find the issues based on various labels. Tools like <a href=\"http://issuehub.io/\">issuehub</a> are really helpful for the same.</p>\n<p>This year <a href=\"https://www.loginradius.com/\">LoginRadius</a> is going to be part of Hacktoberfest by open-sourcing a lot of its projects and accepting contributions on them including its <a href=\"https://www.loginradius.com/blog/engineering/\">Engineering Blog</a>.</p>\n<h3 id=\"getting-loginradius-branded-swags\" style=\"position:relative;\"><a href=\"#getting-loginradius-branded-swags\" aria-label=\"getting loginradius branded swags permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Getting LoginRadius branded swags</h3>\n<p>Like I said, this year <strong>LoginRadius</strong> will be part of hacktoberfest and yes, we are here with some <strong>cool swags.</strong> We have got around <strong>500 t-shirts</strong> for people contributing to our open source repositories. We will soon share details on how to get LoginRadius swags as well as our open source repositories on our <a href=\"https://www.loginradius.com/blog/async\">Blog</a>.</p>\n<p>Stay tuned and <strong>don’t forget to mention your open-source projects for us to contribute.</strong></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"September 18, 2020","updated_date":null,"title":"LoginRadius Supports Hacktoberfest 2020","tags":["hacktoberfest","open-source","LoginRadius"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5873015873015872,"src":"/static/9a2056972f92077b2af8b32ecc2fcbdd/58556/hacktober-fest-banner.webp","srcSet":"/static/9a2056972f92077b2af8b32ecc2fcbdd/61e93/hacktober-fest-banner.webp 200w,\n/static/9a2056972f92077b2af8b32ecc2fcbdd/1f5c5/hacktober-fest-banner.webp 400w,\n/static/9a2056972f92077b2af8b32ecc2fcbdd/58556/hacktober-fest-banner.webp 800w,\n/static/9a2056972f92077b2af8b32ecc2fcbdd/e30b5/hacktober-fest-banner.webp 1000w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Hridayesh Sharma","github":"vyasriday","avatar":null}}}},{"node":{"fields":{"slug":"/identity/announcing-new-look-of-loginradius/"},"html":"<p>LoginRadius is happy to announce that we have a new logo now. </p>\n<p>Yes! We loved the old one, but we decided to upgrade it as part of our ever-evolving branding metrics. After all, progress is impossible without change. </p>\n<p>So, here’s our new look.</p>\n<p><img src=\"/4d9e15e17d42c355ead62634f20c5608/loginradius-logo-horizontal-full-colour-on-white-1024x211.webp\" alt=\"LoginRadius Logo\"></p>\n<p>As a leader in cloud-based Customer Identity and Access Management (CIAM) solution that the following two core principles are reflected in the branding:</p>\n<p><strong>Putting users at the center</strong></p>\n<p>Our platform is all about consumer-brand relationships and to strengthen the relationship we believe we need to put the consumer at the center. So, everything we design and develop, we keep the very end-users i.e. your consumers at the centre. </p>\n<p>Our first priority is to benefit them -- giving them peace of mind by protecting their data, account and privacy; and offering them a delightful experience.</p>\n<p><strong>Security is the foundation of our business</strong></p>\n<p>Security is not a feature but the foundation of our business. Protecting consumers’ data, account and privacy is the most important function of our business and platform. We and our customers never compromise on security. Period.</p>\n<h2 id=\"intend-behind-the-change\" style=\"position:relative;\"><a href=\"#intend-behind-the-change\" aria-label=\"intend behind the change permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Intend Behind The Change</h2>\n<p>Over the years, LoginRadius has exponentially grown from a simple social login provider to an industry-leading customer identity and access management (CIAM) platform. </p>\n<p>Therefore, it is important that we align our designing goals to reflect how we serve our customers, what our milestones are and most importantly, symbolize our future on what more do we intend to achieve.</p>\n<p>Keeping designing and user experience at the core of innovation, our creative thinkers came up with a logo that is crisp, smart, minimalistic and feels connected.</p>\n<p>Needless to say, they got exactly what we intended to project out to the world – user-centric CIAM platform with a strong security foundation.</p>\n<h2 id=\"what-has-changed\" style=\"position:relative;\"><a href=\"#what-has-changed\" aria-label=\"what has changed permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What Has Changed?</h2>\n<p>First, we would like to take a moment to highlight the retirement of our current logo. After all, it had been serving the spirit of LoginRadius since our inception. </p>\n<p>Fast-forward to the present day, the new logo marks a crucial milestone towards representing our brand-building process.</p>\n<p><img src=\"/16753b4de5d78741baf37b75afe3b390/logo-1024x991.webp\" alt=\"LoginRadius Brandmark\"></p>\n<ul>\n<li><strong>Brandmark</strong>:  It comprises two concentric circles. Most obvious is the negative space showing a keyhole which is also a literal radius from the centre to the outer edge. The keyhole represents robust security foundation of our platform. It can also be seen as a user icon, protected by white arms implied by the negative space and by the light blue circle. This demonstrates our philosophy of putting the user at the centre of everything. Both of these ideas speak to the concept of protecting identity.</li>\n<li><strong>Typeface:</strong> Our creative team made a unanimous decision to create a modern typeface that embodies our vision and is strong enough to sustain on its own. Therefore, we thickened the font with solid letters to give more presence to the brand. </li>\n<li><strong>Color</strong>: Colors are an important aspect of our brand personality. Our core colour palette consists of two primary colours viz. tarren blue and cosmic blue. They help to reinforce feelings of safety and confidence towards customer identity.</li>\n</ul>\n<p>Letting go of our core designing heritage was never our objective. Our color palette is the testimony of what we have been for our customers and promotes authenticity in every form.</p>\n<h2 id=\"logo-color-combinations\" style=\"position:relative;\"><a href=\"#logo-color-combinations\" aria-label=\"logo color combinations permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Logo Color Combinations</h2>\n<p><img src=\"/45425ade83137235c58f51ddcfe288d9/logo-2-1024x589.webp\"></p>\n<h2 id=\"a-final-word\" style=\"position:relative;\"><a href=\"#a-final-word\" aria-label=\"a final word permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>A Final Word</h2>\n<p>The new logo is an attempt at modernizing our brand and helping it connect more with our customers. </p>\n<p>Amidst the huge chunk of workload that rebranding brings along, we are super thrilled to share this news and would like to take a moment to thank our loyal customer base. Do share your comments about the change.</p>\n<p><a href=\"https://www.loginradius.com/contact-us?utm_source=blog&#x26;utm_medium=web&#x26;utm_campaign=announcing-new-look-of-loginradius\"><img src=\"/d98399eb71bd29d9efc50cedf469c114/CTA-Graphics-for-Blogs-V03.01-05-2-1024x310.webp\"></a></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"March 25, 2020","updated_date":null,"title":"Announcing New Look of LoginRadius","tags":["LoginRadius","industry-news"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.408450704225352,"src":"/static/b196244089e513074aca00b6736f8973/c0524/Announcing-New-Look-of-LoginRadius.webp","srcSet":"/static/b196244089e513074aca00b6736f8973/61e93/Announcing-New-Look-of-LoginRadius.webp 200w,\n/static/b196244089e513074aca00b6736f8973/1f5c5/Announcing-New-Look-of-LoginRadius.webp 400w,\n/static/b196244089e513074aca00b6736f8973/c0524/Announcing-New-Look-of-LoginRadius.webp 769w","sizes":"(max-width: 769px) 100vw, 769px"}}},"author":{"id":"Rakesh Soni","github":"oyesoni","avatar":"rakesh-soni.webp"}}}},{"node":{"fields":{"slug":"/identity/loginradius-business-continuity-covid-19-outbreak/"},"html":"<p><em>COVID-19 is a global epidemic that demands decisive and robust action.</em></p>\n<p>Following the announcement by the World Health Organization (WHO) to address the <a href=\"https://www.who.int/emergencies/diseases/novel-coronavirus-2019/events-as-they-happen\">coronavirus (COVID-19) threat as a pandemic</a>, organizations across the globe are looking to their Business Continuity Management (BCM) plan to make sure they are covered.</p>\n<p>For LoginRadius, as a SaaS-based customer identity platform,  planning ahead to counter any disruption has always been an essential aspect of its resilience program. </p>\n<p>Consequently, we have put our contingency plan to action to fight the current and future risks to our business, and our customers' businesses, due to the COVID-19 outbreak.</p>\n<h2 id=\"mitigating-risk-by-loginradius\" style=\"position:relative;\"><a href=\"#mitigating-risk-by-loginradius\" aria-label=\"mitigating risk by loginradius permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Mitigating Risk by LoginRadius</h2>\n<p>As the developing situation changes with respect to world health outlook, we have outlined three key areas to ensure our readiness towards workplace mitigation. They include:</p>\n<ul>\n<li>Employee health and safety</li>\n<li>Service operations</li>\n<li>Business operations</li>\n</ul>\n<p>Thereafter, we are prepared to react accordingly to ensure business continuity. Here’s what our plan looks like:</p>\n<p><strong>Employee Health and Safety</strong></p>\n<p>We are mindful of our employees and are up to date on the officially mandated actions related to hygiene and safety at our workstations. Likewise, we have rolled out the following policies:</p>\n<ul>\n<li>Hand-washing policy and education:  We have trained our staff on proper, effective hygiene practices for reducing the risk of contracting or spreading the virus. </li>\n<li>Travel restrictions, guidelines, and recommendations - We have limited all non-essential business travel and travel to designated high-risk regions. </li>\n<li>Remote Workforce - Phase 1: We have allowed optional, voluntary work from home. This measure is already in place. All staff in all locations have the autonomy and flexibility to work remotely to help mitigate the risk of exposure from public transit and closed communal spaces.</li>\n<li>Remote Workforce - Phase 2: We will impose mandatory work from home. If mandated by the government or regulatory bodies, or implemented by LoginRadius management, we are prepared for mandatory full-time remote work. We have already tested this measure and are to enact it as needed.</li>\n<li>We have installed multiple hand sanitizers within the office premises. </li>\n<li>We ensure frequent cleaning and sanitization of our workplaces. </li>\n<li>We have increased space between employees' workstations.</li>\n</ul>\n<p><strong>Service Operations</strong></p>\n<p>As an automated, fully cloud-based software solution redundantly hosted on industry-leading infrastructure providers like Amazon Web Services and Microsoft Azure, the LoginRadius platform is inherently insulated from the business and commercial impacts of the virus. </p>\n<p>This includes impacts from regional staffing and manpower shortages or disruptions in global supply chains.</p>\n<p>We have been working for several weeks with impromptu and scheduled drills to help ensure that operations run without disruption in the eventuality of an outbreak or other critical event which may impact our organization.</p>\n<p><strong>Business Operations</strong></p>\n<p>Similarly, we have rolled out remote working policies for all LoginRadius team members. Employees can work offsite as they would on-premises, guaranteeing no disruption to business operations, including our customer-facing sales, customer success, support, and account management teams.</p>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>We place the highest value on the partnerships that we've established with our customers and stakeholders. Rest assured, we are committed to ensuring uninterrupted success, even in times of hardship and challenges.</p>\n<p>In the end, we wish our customers health, security, and good fortune.</p>\n<p><a href=\"https://www.loginradius.com/contact-us?utm_source=blog&#x26;utm_medium=web&#x26;utm_campaign=loginradius-business-continuity-covid-19-outbreak\"><img src=\"/d98399eb71bd29d9efc50cedf469c114/CTA-Graphics-for-Blogs-V03.01-05-3-1024x310.webp\"></a></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"March 17, 2020","updated_date":null,"title":"LoginRadius Announces Its Business Continuity Plan to Fight COVID-19 Outbreak","tags":["LoginRadius","industry-news"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.408450704225352,"src":"/static/cbe783d369681847892f38c91f3084cf/c0524/loginradius-business-continuity.webp","srcSet":"/static/cbe783d369681847892f38c91f3084cf/61e93/loginradius-business-continuity.webp 200w,\n/static/cbe783d369681847892f38c91f3084cf/1f5c5/loginradius-business-continuity.webp 400w,\n/static/cbe783d369681847892f38c91f3084cf/c0524/loginradius-business-continuity.webp 769w","sizes":"(max-width: 769px) 100vw, 769px"}}},"author":{"id":"Rakesh Soni","github":"oyesoni","avatar":"rakesh-soni.webp"}}}},{"node":{"fields":{"slug":"/identity/loginradius-named-ciam-leader-owi/"},"html":"<p>LoginRadius is one of 415 identity companies selected from a pool of over 2,000 to be featured in the report.</p>\n<p>VANCOUVER, BC – December 2, 2019 – <a href=\"https://www.loginradius.com/\">LoginRadius</a>, a leader in cloud-based customer identity and access management (CIAM) solutions, is pleased to announce that </p>\n<p><a href=\"https://oneworldidentity.com/\">One World Identity</a> (OWI) has named LoginRadius as a leader in customer identity and access management (CIAM) in its <a href=\"https://www.prnewswire.com/news-releases/one-world-identity-releases-2019-identity-industry-landscape-300963181.html\">2019 Identity Industry Landscape</a>.</p>\n<p>OWI is a leading market intelligence and strategy firm focused on identity, trust, and the data economy. Its annual Identity Landscape provides a comprehensive and holistic view of leading companies in the identity space. This includes an unparalleled overview of how digital identity applications are evolving, as well as how companies and markets are shaping the next generation of digital identity. </p>\n<p>“Since 2017, the number of identity companies has more than quadrupled, from 500 companies to over 2,000,” said Travis Jarae, CEO and Founder of OWI. “With the wave of data breaches and privacy scandals, there is a rapid expansion of identity products and solutions.</p>\n<p>The OWI team interacts with identity companies every day, from startups to enterprise. We’re proud to share the Identity Landscape each year to distill how new companies, products, and solutions are shaping the future of identity.”</p>\n<p>“LoginRadius is honoured to be one of the 415 identity companies selected from a pool of over 2,000 companies in the industry,”. “We are committed to empowering businesses to safely secure their customers’ identities while complying with existing and future regulations and delivering a unified digital experience</p>\n<p><a href=\"https://www.loginradius.com/resource/guide-to-modern-customer-identity/\"><img src=\"/96b65dafa8f2f84ceb9815f9722b0e82/modern-ciam.webp\" alt=\"modern-ciam\"></a></p>\n<p>The OWI Identity Landscape is a tool to help companies keep track of market growth and trends and understand the strategic importance of digital identity moving into 2020 and beyond. OWI will be releasing a more detailed research report delving into the details of each market segment and how companies within the industry overlap and intersect in upcoming months. </p>\n<p>Download a complimentary copy of OWI’s 2019 Industry Landscape at <a href=\"https://oneworldidentity.com/2019-identity-landscape/\">www.oneworldidentity.com/landscape</a>. </p>\n<p><strong>About OWI</strong></p>\n<p>OWI is a market intelligence and strategy firm focused on identity, trust, and the data economy. Through advisory services, events and research, OWI helps a wide range of public and privately held companies, investors and governments stay ahead of market trends, so they can build sustainable, forward-looking products and strategies. OWI was founded in 2015 and is the host of the <a href=\"https://www.knowidentity.com/\">KNOW Identity</a> Conference that takes place in Vegas April 5-8, 2020.</p>\n<p><strong>About LoginRadius</strong></p>\n<p>LoginRadius is a leading cloud-based <a href=\"https://www.loginradius.com/blog/identity/customer-identity-and-access-management/\">customer identity and access management</a> (CIAM) solution securing more than one billion user identities worldwide.</p>\n<p>The LoginRadius Identity Platform empowers business and government organizations to manage customer identities securely, deliver a unified digital experience, and comply with all major privacy regulations such as the EU’s General Data Protection Regulation (GDPR).</p>\n<p><a href=\"https://www.loginradius.com/contact-us?utm_source=blog&#x26;utm_medium=web&#x26;utm_campaign=loginradius-named-ciam-leader-owi\"><img src=\"/1bebf239d110701b9b534d7eb481a5ac/BD-Plexicon1-1024x310-1.webp\" alt=\"book-a-demo-loginradius\"></a></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"December 02, 2019","updated_date":null,"title":"One World Identity Report Names LoginRadius a Customer Identity and Access Management (CIAM) Industry Leader","tags":["media-and-publication","LoginRadius"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.408450704225352,"src":"/static/57a7390f435ce9a0c99194bcda65a867/7f8e9/blog-graphic-one-world-identity.webp","srcSet":"/static/57a7390f435ce9a0c99194bcda65a867/61e93/blog-graphic-one-world-identity.webp 200w,\n/static/57a7390f435ce9a0c99194bcda65a867/1f5c5/blog-graphic-one-world-identity.webp 400w,\n/static/57a7390f435ce9a0c99194bcda65a867/7f8e9/blog-graphic-one-world-identity.webp 768w","sizes":"(max-width: 768px) 100vw, 768px"}}},"author":{"id":"Rakesh Soni","github":"oyesoni","avatar":"rakesh-soni.webp"}}}}]}},"pageContext":{"tag":"LoginRadius"}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}