{"componentChunkName":"component---src-templates-blog-list-template-js","path":"/38","result":{"data":{"allMarkdownRemark":{"edges":[{"node":{"excerpt":"Introduction In a modern digital world where businesses are swiftly adopting new technologies to safeguard crucial information from various…","fields":{"slug":"/identity/mfa-prompt-bombing-businesses/"},"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>In a modern digital world where businesses are swiftly adopting new technologies to safeguard crucial information from various threat vectors, multi-factor authentication (MFA) prompt bombing could be the next big thing to worry about. </p>\n<p>C-level executives, including CTOs, and IT staff of organizations globally, are concerned about the increasing risks and threats associated with MFA prompt bombing. </p>\n<p>The MFA prompt attacks typically try to leverage MFA fatigue where users get annoyed and unknowingly or unwillingly accept authentication attempts initiated by cyber attackers. </p>\n<p>In a post-COVID world, when cybercriminals are exploring new ways to exploit customer identities and sensitive business information, ensuring <a href=\"https://www.loginradius.com/blog/growth/how-businesses-approach-customer-security/\">robust security for customers</a> and employees becomes the need of the hour. </p>\n<p>Let’s understand the aspects associated with MFA prompt bombing attacks and how businesses can reinforce their overall security infrastructure.</p>\n<h2 id=\"what-is-an-mfa-prompt-bombing-attack-why-shouldnt-businesses-ignore-it\" style=\"position:relative;\"><a href=\"#what-is-an-mfa-prompt-bombing-attack-why-shouldnt-businesses-ignore-it\" aria-label=\"what is an mfa prompt bombing attack why shouldnt businesses ignore 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>What is an MFA Prompt Bombing Attack? Why Shouldn’t Businesses Ignore it?</h2>\n<p>MFA prompt bombing can be defined as a cyber attack that utilizes <a href=\"https://www.loginradius.com/blog/identity/what-is-multi-factor-authentication/\">multi-factor authentication</a> so that users don’t even realize that they authenticate a cybercriminal to access their account. </p>\n<p>Cybercriminals that have obtained user credentials rigorously send second-factor authentication requests to the user by email or phone (OTP). </p>\n<p>The frustrated user may accidentally click on the link to verify the login attempt, and that’s all it takes to make MFA prompt bombing successful. </p>\n<p>Attackers trigger the MFA by sending an authentication link or OTP repeatedly, and the user will accidentally provide approval for the same. </p>\n<p>And things get extremely complicated when a platform supports push-based MFA authentication. This leads to a situation where a single tap, whether intentional or unintentional, may lead to severe consequences. </p>\n<p>Hence, businesses must consider certain security measures and risks before incorporating multi-factor authentication into their websites and applications. </p>\n<h2 id=\"how-risk-based-authentication-can-reinforce-authentication-security\" style=\"position:relative;\"><a href=\"#how-risk-based-authentication-can-reinforce-authentication-security\" aria-label=\"how risk based authentication can reinforce authentication 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>How Risk-Based Authentication Can Reinforce Authentication Security?</h2>\n<p><a href=\"https://www.loginradius.com/blog/identity/risk-based-authentication/\">Risk-based authentication</a> (RBA) is a method to send notifications or prompt the consumers to complete an additional step(s) to verify their identities when the authentication request is deemed malicious according to your organization's security policy. </p>\n<p>RBA allows users to log in using a username and password without presenting any additional authentication barrier while providing a security layer whenever a malicious attempt is made to access the system.</p>\n<p>Risk-based authentication is a great security mechanism that helps overcome the challenges associated with MFA prompt bombing since it automatically detects the risks and unusual behavior from a particular account and restricts access. </p>\n<p><a href=\"https://www.loginradius.com/resource/an-enterprises-guide-to-risk-based-authentication/\"><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 30.307692307692307%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAAAsSAAALEgHS3X78AAABhUlEQVQY00WROW8TURSFLaTEHo+j2BPLzuKFxDNeZDvGGW/MeAlMYju7EU0gKRKlCwpUqbI0VP4liIYCGqIUCCpo6Ggo+Csf7z1LUJyrq6tzz7mLT8u66PkeRsrEmI/hnV5weDUmVXUxbZdIsUMg20YTCJgOwaJHtPWMuVUPrbRBQPRqlkvAmnB8MgTzXYxkhmBIw4jHyFSq5FyP5bJNuND+R9YsB728QerJC4qbh+it5/hLfVVXhkLYJ4MuBdNZ9HCEqdAMhlmm0h+RzheIrq7jFxw5RXxtwMPHe8yv9VWeqA1ZcfZJNHeZKfT+C8qVEpU29vqQkuNR7Q1YtoVJvkasuqmIcgJpHLcHLDW2WaxvsVDfFmI7RMpPJ6ZqZZEEcx3iotHqHAiMsLojko0hs8WeIksh38IjXl2P+fX7Dx8+f+Hdxzvef7rn64+f3H37TljwpjPO5IbqjkLUb7oCDtMC8m4hsYasSzxIN2genHAuHnb0+oaXF9cKZ5dvOX5zK7hdNeVfDIjC2IX3+/4AAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"GD-to-RBA\"\n        title=\"GD-to-RBA\"\n        src=\"/static/d57f9c65049003fa8427fb6d0893f180/e5715/GD-to-RBA.png\"\n        srcset=\"/static/d57f9c65049003fa8427fb6d0893f180/a6d36/GD-to-RBA.png 650w,\n/static/d57f9c65049003fa8427fb6d0893f180/e5715/GD-to-RBA.png 768w,\n/static/d57f9c65049003fa8427fb6d0893f180/81501/GD-to-RBA.png 2886w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></a></p>\n<h2 id=\"how-risk-based-authentication-works-for-protecting-against-mfa-prompt-bombing\" style=\"position:relative;\"><a href=\"#how-risk-based-authentication-works-for-protecting-against-mfa-prompt-bombing\" aria-label=\"how risk based authentication works for protecting against mfa prompt bombing 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 Risk-Based Authentication Works for Protecting Against MFA Prompt Bombing?</h2>\n<p>Whenever an authentication request is deemed as a malicious attempt based on the risk factors defined for your application, risk-based authentication triggers one or more of the following actions according to your business requirements:</p>\n<ul>\n<li><strong>Email Notification:</strong> An email is sent to notify the consumer about the authentication request. If the consumer finds the authentication request malicious, they can inform the business to take appropriate actions.</li>\n<li><strong>SMS Notification:</strong> An SMS is sent to the consumer's phone number to notify the consumer about the authentication request. It gives an advantage as the consumer checks the SMS more frequently than email, or the consumer might not have access to the email. If the consumer finds the authentication request malicious, they can inform the company to take appropriate actions.</li>\n<li><strong>Blocking User Access:</strong> The account is blocked immediately for further login attempts once specific risk criteria have been met. The consumer needs to contact the company to unblock the access.</li>\n<li><strong>Security Questions:</strong> This forces the consumer to answer one or more security questions before authenticating the request.</li>\n</ul>\n<h2 id=\"final-thoughts\" style=\"position:relative;\"><a href=\"#final-thoughts\" aria-label=\"final thoughts 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>Final Thoughts</h2>\n<p>With the increasing cybersecurity threat landscape in the digital-first era, MFA prompt bombing could be the most challenging thing to deal with. </p>\n<p>Businesses need to understand the risks associated with account takeovers through various attacks, including MFA prompt bombing, and should plan overall security infrastructure accordingly. </p>\n<p>Organizations can invoke the true potential of risk-based authentication (RBA) to overcome the challenges pertaining to MFA prompt bombing. </p>\n<p><a href=\"https://www.loginradius.com/book-a-demo/\"><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 30.307692307692307%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAAAsSAAALEgHS3X78AAABdElEQVQY002RO0/CUBzFG6PtbZWHCAmRmBB5P8vDII9SSC0omog4oAEGjZMO6OKEuLjoJ2Fx0cSBwUQnXZxcHPwux38LJA7nNvfec8+5v1tOCCiwpbbhye2BxbYgBMtgIRVioDRRsARGXxZUzLlEHmehBaesQ4rrEMPViYf2DR9nDGKkChbVICVqsMt1WJI1sHCFwhUsUIFohJH49TxECvRUjhDW2mAbB5iP6hB8hUkhiRPN5KIZYJdrsEYrcCSpmQqMm6/m9ylUhSulY7N5ivROB3L9GOlGF3Ktbc4zuz341UPw/uIk0ESbBjoSGlYIx8BfzjSwVmyCEYEUUmCPa3Bnd+hwC75yC95S05SxbolU/iEbOCFCpDexEfIioTNCNd6Tp6IlMnNuGeeDe3z//OLx5RWj5zFGT2O8fXxh/P4Ja6w6vSEFCnTIlW2YiDzhzX7ATFKojDlvjpBPcDF4QPdyiG5/iE7/BmfXd+hd3VKpCoG8fzxWw2+c+yTpAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"book-a-demo-loginradius\"\n        title=\"book-a-demo-loginradius\"\n        src=\"/static/fcc4c4b5dc38cc4528f99d09480f4eb2/e5715/book-a-demo-loginradius.png\"\n        srcset=\"/static/fcc4c4b5dc38cc4528f99d09480f4eb2/a6d36/book-a-demo-loginradius.png 650w,\n/static/fcc4c4b5dc38cc4528f99d09480f4eb2/e5715/book-a-demo-loginradius.png 768w,\n/static/fcc4c4b5dc38cc4528f99d09480f4eb2/63ff0/book-a-demo-loginradius.png 2887w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></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":"August 08, 2022","updated_date":null,"description":"The MFA prompt attacks typically leverage MFA fatigue, where users get annoyed and unknowingly or unwillingly accept authentication attempts initiated by cyber attackers. This post uncovers the aspects associated with MFA prompt bombing attacks and how businesses can reinforce their overall security infrastructure.","title":"MFA Prompt Bombing: Is it a New Threat Vector to Worry About?","tags":["MFA","risk-based authentication","user access"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.3986013986013985,"src":"/static/dfe38be88507741cfd42df8884a69e39/33aa5/mfa-prompt.jpg","srcSet":"/static/dfe38be88507741cfd42df8884a69e39/f836f/mfa-prompt.jpg 200w,\n/static/dfe38be88507741cfd42df8884a69e39/2244e/mfa-prompt.jpg 400w,\n/static/dfe38be88507741cfd42df8884a69e39/33aa5/mfa-prompt.jpg 768w","sizes":"(max-width: 768px) 100vw, 768px"}}},"author":{"id":"Alok Patidar","github":null,"avatar":null}}}},{"node":{"excerpt":"Introduction Technology has evolved leaps and bounds in the past decade, and every business, regardless of the niche, has already jumped on…","fields":{"slug":"/identity/loginradius-ceo-shifting-data-strategies/"},"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>Technology has evolved leaps and bounds in the past decade, and every business, regardless of the niche, has already jumped on the digital transformation bandwagon. </p>\n<p>Whether we talk about incorporating smart devices or <a href=\"https://www.loginradius.com/blog/identity/what-is-cloud-computing/\">adopting cloud computing</a> for thriving business success, technology has undoubtedly laid the foundation for a successful business in this era. </p>\n<p>However, integrating technology into business doesn’t guarantee a secure IT infrastructure, especially when cybercriminals find new ways to exploit customer identities. </p>\n<p>Since data is the essential fuel that keeps businesses up and running, a little sneak into crucial customer details can cause massive destruction for an enterprise in terms of hefty fines and reputational damages. </p>\n<p>With more and more businesses taking place online and grappling with the new privacy and data security complexities, there’s an immediate need to reinvent data management strategies. </p>\n<p>Let’s understand the role of privacy and data management and how businesses can take the competitive edge. </p>\n<h2 id=\"privacy-management-in-2022-and-beyond\" style=\"position:relative;\"><a href=\"#privacy-management-in-2022-and-beyond\" aria-label=\"privacy management in 2022 and beyond 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>Privacy Management in 2022 and Beyond</h2>\n<p>Things have rapidly changed in the digital business landscape, and customers are increasingly becoming obsessed with how enterprises manage their personal data. </p>\n<p>Furthermore, <a href=\"https://www.loginradius.com/customer-privacy/\">global data privacy</a> and security regulations are also becoming more stringent. This means that businesses that aren’t complying with the regulations like the GDPR and the CCPA would eventually face issues pertaining to customer trust and loyalty. </p>\n<p>Hence, if a brand needs to build customer loyalty and trust in this digital-first era, it should comply with data privacy and security regulations. </p>\n<p>Now talking about the true potential of customer data, brands that aren’t leveraging customer insights would surely lag behind their competitors. </p>\n<p>Over a decade, customer insights have been the game-changer for businesses striving for overall success since they can offer personalized customer journeys and deliver what their end users demand. </p>\n<p><span style=\"color: #FF4500\">“<em>Rapid technology adoption has undeniably helped organizations navigate their digital transformation journey. However, the speed of technology adoption in a data-centric landscape without assessing underlying risks has created endless privacy pitfalls</em>\"</p>\n<p>Hence, the ones seeking competitive advantage without losing customer trust must rethink their privacy and data management policies. </p>\n<p>Let’s look at data and privacy shifts that could help businesses grow in 2022 and beyond. </p>\n<h3 id=\"1-data-literacy\" style=\"position:relative;\"><a href=\"#1-data-literacy\" aria-label=\"1 data literacy 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. Data literacy</h3>\n<p>Organizations that go out-of-the-box and separate themselves from competitors will be those willing to adapt to a new way of working with privacy and agility. </p>\n<p>Data literacy is swiftly becoming the need of the hour within a business organization that requires a top-down data management approach that ensures data is viewed as insights to drive overall business growth. </p>\n<p>For instance, valuable customer data collected through registration forms can be utilized to build a personalized customer experience that offers customers what they’re actually looking for by carefully examining their behavior and preferences. </p>\n<h3 id=\"2-shifting-from-conventional-data-strategy\" style=\"position:relative;\"><a href=\"#2-shifting-from-conventional-data-strategy\" aria-label=\"2 shifting from conventional data strategy 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. Shifting from conventional data strategy</h3>\n<p>Relying on old-school data strategy could be fatal for businesses serving customers online since market leaders already leverage cutting-edge technologies and tools to stand ahead of the curve. </p>\n<p>For instance, most businesses now rely on <a href=\"https://www.loginradius.com/blog/identity/digital-identity-management/\">identity management</a> solutions to ensure they comply with global data privacy and regulatory requirements. </p>\n<p>Also, a customer identity and access management (CIAM) solution can help businesses deliver a flawless user experience reinforced by security. </p>\n<p>Moreover, customers love to share their personal details if they are catered to with a rich user experience through a CIAM with <a href=\"https://www.loginradius.com/progressive-profiling/\">progressive profiling</a>. This feature allows brands to collect crucial customer data gradually over time instead of a huge registration form. </p>\n<h3 id=\"3-managing-security-privacy-compliance-and-user-experience\" style=\"position:relative;\"><a href=\"#3-managing-security-privacy-compliance-and-user-experience\" aria-label=\"3 managing security privacy compliance and user experience 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. Managing security, privacy, compliance, and user experience</h3>\n<p>Brands cannot just focus on user experience anymore; customers now demand security, privacy, compliance, and customer experience- all under one roof. </p>\n<p>The market is flooded with endless options for almost every business niche, and customers won’t take a second thought to switch if they aren’t served with the desired experience. </p>\n<p>In a nutshell, if a business offers privacy, security, compliance, and user experience through its platform, it’ll stand ahead of the competition. </p>\n<p>A <a href=\"https://www.loginradius.com/\">cutting-edge CIAM solution</a> can help brands overcome these challenges like a breeze. </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>The modern digital business landscape has offered endless opportunities for enterprises to leverage their customer insights. However, they need to strategize things from a whole new different perspective. </p>\n<p>Whether it’s the incorporation of a reliable CIAM or other privacy management solutions, brands have to put their best efforts into ensuring robust privacy management. </p>\n<p><a href=\"https://www.loginradius.com/book-a-demo/\"><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 30.307692307692307%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAAAsSAAALEgHS3X78AAABdElEQVQY002RO0/CUBzFG6PtbZWHCAmRmBB5P8vDII9SSC0omog4oAEGjZMO6OKEuLjoJ2Fx0cSBwUQnXZxcHPwux38LJA7nNvfec8+5v1tOCCiwpbbhye2BxbYgBMtgIRVioDRRsARGXxZUzLlEHmehBaesQ4rrEMPViYf2DR9nDGKkChbVICVqsMt1WJI1sHCFwhUsUIFohJH49TxECvRUjhDW2mAbB5iP6hB8hUkhiRPN5KIZYJdrsEYrcCSpmQqMm6/m9ylUhSulY7N5ivROB3L9GOlGF3Ktbc4zuz341UPw/uIk0ESbBjoSGlYIx8BfzjSwVmyCEYEUUmCPa3Bnd+hwC75yC95S05SxbolU/iEbOCFCpDexEfIioTNCNd6Tp6IlMnNuGeeDe3z//OLx5RWj5zFGT2O8fXxh/P4Ja6w6vSEFCnTIlW2YiDzhzX7ATFKojDlvjpBPcDF4QPdyiG5/iE7/BmfXd+hd3VKpCoG8fzxWw2+c+yTpAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"LoginRadius Book a Demo\"\n        title=\"LoginRadius Book a Demo\"\n        src=\"/static/fcc4c4b5dc38cc4528f99d09480f4eb2/e5715/book-a-demo-loginradius.png\"\n        srcset=\"/static/fcc4c4b5dc38cc4528f99d09480f4eb2/a6d36/book-a-demo-loginradius.png 650w,\n/static/fcc4c4b5dc38cc4528f99d09480f4eb2/e5715/book-a-demo-loginradius.png 768w,\n/static/fcc4c4b5dc38cc4528f99d09480f4eb2/63ff0/book-a-demo-loginradius.png 2887w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></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":"August 02, 2022","updated_date":null,"description":"With more and more businesses taking place online and grappling with the new privacy and data security complexities, there’s an immediate need to reinvent data management strategies. Let’s understand the role of privacy and data management and how businesses can take the competitive edge.","title":"Privacy-Centric Enhancements: CEO Rakesh Soni Shares His Thoughts on Shifting Data Strategies","tags":["data privacy","cloud computing","progressive profiling"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.3888888888888888,"src":"/static/1bd8d21614ab2fc2584ea37413745cc6/33aa5/privacy-centric.jpg","srcSet":"/static/1bd8d21614ab2fc2584ea37413745cc6/f836f/privacy-centric.jpg 200w,\n/static/1bd8d21614ab2fc2584ea37413745cc6/2244e/privacy-centric.jpg 400w,\n/static/1bd8d21614ab2fc2584ea37413745cc6/33aa5/privacy-centric.jpg 768w","sizes":"(max-width: 768px) 100vw, 768px"}}},"author":{"id":"Rakesh Soni","github":"oyesoni","avatar":"rakesh-soni.jpg"}}}},{"node":{"excerpt":"Introduction Marketers are no longer in the business of attracting customers; they're responsible for keeping them engaged. That shift has…","fields":{"slug":"/growth/authentication-critical-customer-acquistion-tool/"},"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>Marketers are no longer in the business of attracting customers; they're responsible for keeping them engaged. That shift has led to a new role in marketing — user authentication.</p>\n<p>Authentication is the process of confirming the identity of a user. In the digital world, it's used to verify that someone is who they say they are and that their information is accurate.</p>\n<p>It's an important responsibility because it helps marketers protect their brands from fraud and abuse. From phishing scams to fake reviews, there are many ways scammers try to game the system to steal money or reputations.</p>\n<h2 id=\"what-is-user-authentication\" style=\"position:relative;\"><a href=\"#what-is-user-authentication\" aria-label=\"what is user 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 User Authentication?</h2>\n<p><a href=\"https://www.loginradius.com/blog/identity/what-is-authentication/\">User authentication</a> is the process of verifying that a user is who they claim to be.</p>\n<p>Authentication is the most important security feature any application can have because it's the gateway through which users interact with your data. Without proper authentication, an attacker could impersonate your users and access sensitive information or perform unauthorised actions on their behalf.</p>\n<p>Moreover, authentication is often <a href=\"https://www.loginradius.com/blog/identity/authentication-vs-authorization-infographic/\">confused with authorization</a>, which determines whether a user has the right to perform an action on a resource. That's why it's best to think of authentication as \"proving you are who you say you are\" and authorisation as \"determining what actions can be performed.\"</p>\n<p>This distinction is important because some authentication mechanisms provide very strong guarantees about who can perform certain actions, while others only provide weaker guarantees about behaviour over time. For example, someone who knows your password may be able to access your account now but not later; however, someone who has been issued an RSA token or a biometric fingerprint reader will always be able to access your account until they lose possession of their device or their fingerprint changes significantly enough that their device no longer recognizes them.</p>\n<h2 id=\"how-marketers-can-leverage-user-authentication\" style=\"position:relative;\"><a href=\"#how-marketers-can-leverage-user-authentication\" aria-label=\"how marketers can leverage user 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>How Marketers Can Leverage User Authentication?</h2>\n<p>Authentication is important in marketing because it helps to ensure that only real users get access to your content and products. If you allow anonymous access to your website or application, then anyone could be a potential customer of your product. However, only those who have registered themselves with you can access your content and services if you use authentication.</p>\n<p>Authentication helps marketers in many ways:</p>\n<h3 id=\"1-reduce-fraud-with-customer-verification\" style=\"position:relative;\"><a href=\"#1-reduce-fraud-with-customer-verification\" aria-label=\"1 reduce fraud with customer verification 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. Reduce fraud with customer verification.</h3>\n<p>User authentication is the process of collecting information about a user's identity to verify that they are who they claim to be. By authenticating users, you can ensure that only authorized users have access to your website or platform. This helps protect your site from fraud, abuse, and other security issues that might arise if it were not securely protected.</p>\n<p><strong>A Good Read:</strong> <a href=\"https://www.loginradius.com/blog/identity/how-to-improve-customer-verification-process/\">5 Ways to Improve Your Customer Verification Process</a></p>\n<h3 id=\"2-improve-customer-experience\" style=\"position:relative;\"><a href=\"#2-improve-customer-experience\" aria-label=\"2 improve customer experience 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. Improve customer experience.</h3>\n<p>User authentication allows marketers to better understand who their customers are and what they want. This can help improve the overall customer experience. For example, if you’re an online retailer, it would be helpful to know if a person has purchased from your site before or not so that you can tailor their experience accordingly.</p>\n<p>When prospective customers see that you're taking steps to verify their identities before doing business with them, it sends a signal that you're serious about security and privacy — which can build trust among potential buyers who might otherwise be wary of providing personal information to an unknown entity online.</p>\n<h3 id=\"3-boost-conversion-rates\" style=\"position:relative;\"><a href=\"#3-boost-conversion-rates\" aria-label=\"3 boost conversion rates 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. Boost conversion rates.</h3>\n<p><a href=\"https://www.loginradius.com/blog/growth/authentication-tools-boost-sales/\">Authentication tools</a> can help boost conversion rates by reducing the number of duplicate account registrations and false positives. When a user enters their email address or phone number, they'll receive a confirmation code via text or email to verify that they're not registering multiple accounts with the same information. This helps reduce abandoned shopping carts and returns while also increasing conversions.</p>\n<p>The best part? You don't need to build any additional forms or create new pages on your site — you can just add a login box and ask people to log in before they give you their feedback. Using user authentication in this way is particularly useful if you're looking for feedback on something specific, like an upcoming product launch or a new feature that's not yet available publicly.</p>\n<h3 id=\"4-increase-customer-retention\" style=\"position:relative;\"><a href=\"#4-increase-customer-retention\" aria-label=\"4 increase customer retention 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. Increase customer retention.</h3>\n<p>Customer retention is one of the biggest challenges in the industry today. Customers are constantly being bombarded by new products, offers, and promotions. It’s difficult to keep them engaged and coming back to your brand.</p>\n<p>User authentication allows marketers to <a href=\"https://www.loginradius.com/blog/growth/improve-customer-relation-brand-identity/\">improve customer retention</a> by offering them a more personalized experience. By leveraging user authentication, marketers can tailor their marketing efforts toward their existing customers.</p>\n<h3 id=\"5-improve-content-personalization\" style=\"position:relative;\"><a href=\"#5-improve-content-personalization\" aria-label=\"5 improve content personalization 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. Improve content personalization.</h3>\n<p>By identifying their users' preferences, marketers can create personalized content that resonates with them based on their previous actions on the site. For example, if someone has visited a certain page before and viewed a certain product, they will likely be interested in related products as well. With this information at hand, it's easier for brands to cater to individual needs by showing them relevant content and products over time that align with their interests.</p>\n<p>By improving content personalization and increasing customer satisfaction, marketers can generate more revenue through repeat purchases and referrals from happy customers!</p>\n<h2 id=\"wrapping-up\" style=\"position:relative;\"><a href=\"#wrapping-up\" aria-label=\"wrapping 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>Wrapping Up</h2>\n<p>As the world becomes more connected, users have become increasingly more aware of their digital privacy. In fact, according to a recent study from Google and Ipsos, 70% of Americans are concerned about their online privacy.</p>\n<p>Marketers need to strike a balance between user security and experience when it comes to user privacy. That means providing security services that won't frustrate customers who want to get the most out of their devices and applications.</p>\n<p><a href=\"https://www.loginradius.com/book-a-demo/\"><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 30.307692307692307%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAAAsSAAALEgHS3X78AAABdElEQVQY002RO0/CUBzFG6PtbZWHCAmRmBB5P8vDII9SSC0omog4oAEGjZMO6OKEuLjoJ2Fx0cSBwUQnXZxcHPwux38LJA7nNvfec8+5v1tOCCiwpbbhye2BxbYgBMtgIRVioDRRsARGXxZUzLlEHmehBaesQ4rrEMPViYf2DR9nDGKkChbVICVqsMt1WJI1sHCFwhUsUIFohJH49TxECvRUjhDW2mAbB5iP6hB8hUkhiRPN5KIZYJdrsEYrcCSpmQqMm6/m9ylUhSulY7N5ivROB3L9GOlGF3Ktbc4zuz341UPw/uIk0ESbBjoSGlYIx8BfzjSwVmyCEYEUUmCPa3Bnd+hwC75yC95S05SxbolU/iEbOCFCpDexEfIioTNCNd6Tp6IlMnNuGeeDe3z//OLx5RWj5zFGT2O8fXxh/P4Ja6w6vSEFCnTIlW2YiDzhzX7ATFKojDlvjpBPcDF4QPdyiG5/iE7/BmfXd+hd3VKpCoG8fzxWw2+c+yTpAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"book-a-demo-loginradius\"\n        title=\"book-a-demo-loginradius\"\n        src=\"/static/fcc4c4b5dc38cc4528f99d09480f4eb2/e5715/book-a-demo-loginradius.png\"\n        srcset=\"/static/fcc4c4b5dc38cc4528f99d09480f4eb2/a6d36/book-a-demo-loginradius.png 650w,\n/static/fcc4c4b5dc38cc4528f99d09480f4eb2/e5715/book-a-demo-loginradius.png 768w,\n/static/fcc4c4b5dc38cc4528f99d09480f4eb2/63ff0/book-a-demo-loginradius.png 2887w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></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 29, 2022","updated_date":null,"description":"Authentication is the most important security feature any application can have because it's the gateway through which users interact with your data. This blog explains how marketers can leverage user authentication.","title":"Authentication Has Gone Mainstream: Are Marketers Ready to Take the Responsibility?","tags":null,"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7094017094017093,"src":"/static/a3c98cbf34311a97198a605d6fc32266/33aa5/auth-marketers.jpg","srcSet":"/static/a3c98cbf34311a97198a605d6fc32266/f836f/auth-marketers.jpg 200w,\n/static/a3c98cbf34311a97198a605d6fc32266/2244e/auth-marketers.jpg 400w,\n/static/a3c98cbf34311a97198a605d6fc32266/33aa5/auth-marketers.jpg 768w","sizes":"(max-width: 768px) 100vw, 768px"}}},"author":{"id":"Navanita Devi","github":null,"avatar":null}}}},{"node":{"excerpt":"Introduction We’re in an era where rich customer experiences backed with robust identity security is all that user need from businesses. And…","fields":{"slug":"/identity/fix-identity-to-fix-citizens-security/"},"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>We’re in an era where rich customer experiences backed with robust identity security is all that user need from businesses. And the same is expected from private sector organizations. </p>\n<p>However, when we talk about citizens’ experience and security, most government and public sector organizations seem impotent to match the level of security and usability. </p>\n<p>Hence, issues about identity management in the government sector linger on that can severely impact citizens’ privacy and information security. </p>\n<p>So, what can be the ideal solution to ensure robust identity security without hampering <a href=\"https://www.loginradius.com/blog/identity/improving-customer-experience-public-sector/\">user experience in the public sector</a>? </p>\n<p>Here’s where the crucial role of identity management comes into play! </p>\n<p>Identity management has been a game-changer for enterprises for decades as it helps businesses succeed by ensuring the highest level of security and great user experience. </p>\n<p>Let’s understand the aspects of leveraging identity management through a reliable customer identity and access management (CIAM) platform for fixing security and usability issues in the public sector. </p>\n<h2 id=\"the-power-of-digital-identity-for-smart-cities\" style=\"position:relative;\"><a href=\"#the-power-of-digital-identity-for-smart-cities\" aria-label=\"the power of digital identity for smart cities 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 Power of Digital Identity for Smart Cities</h2>\n<p>With population growth and expanding public services, cities must be innovative about providing services to all people without compromising service quality. There is a need for a single platform where all facilities are centralized and customer experience is considered.</p>\n<p><a href=\"https://www.loginradius.com/blog/identity/digital-identity-management/\">Identity management</a> in the government sector is a great way to get started as it can prove a citizen’s identity through diverse government channels without compromising user experience. </p>\n<p>As the government invokes the potential of secure digital identities, citizens would access core services and resources without hassle.</p>\n<p>Moreover, every citizen requires some kind of public service, so securely handling a unique number of identities becomes a tough nut to crack for the government. Here’s where the need for digital identity management comes into play.</p>\n<p>A smart CIAM (consumer identity and access management) solution like LoginRadius helps public sector organizations manage multiple identities efficiently without hampering user experience.</p>\n<p>Let’s learn how a CIAM solution like LoginRadius can deliver a flawless digital experience to civilians that pushes overall development reinforced by adequate security.</p>\n<p><a href=\"https://www.loginradius.com/resource/how-cities-use-loginradius-identity-platform/-\"><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 30.307692307692307%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAAAsSAAALEgHS3X78AAABc0lEQVQY01WRy0tCYRDFL1E+rkqWFoao0VPMB2qoWWamKRoZ0iJ8RJG7Slu1Ktu0qj8kWkRQRFGRG1e1adkmKAqidpYgJNhprnqRFofhOzPzG2Y+Rjw0AU7ssAcS/SSkJC6ynNfI8RINuMGO+KF0xaAw+yE2BiDSeyEeHIeIy5MYHqa0BCA3+gjmgcwwhR5XFAp7GHLTNETUwAMlphlofXEYAotgnQsQmoJN4GADKCRD547CHVuFORiH2hFBGzV30hCZwdsEUpTScJUtCJU9BK0jjC6qEVAtv0UdSAYHCqUysIQSsIaTBE8jspxFtzVI+TqQb1Q7ZqEbm4OG1GHyo7XP9R/IGccXeXyXSnh5fcP7xyeKxS/8VCoIJNbR0usAo7ZhI3eAx6dnnFzmcXh6haOzaxTuH3BTuEM7nUvQ7wbDNoDntwUAVZQIWi6Xa/qtVhFayoDRjNZqnPMrWNveR2ozh0R2B8lsDumtPXrv1j6TO90faUzgCcbbqyQAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"cities-ds\"\n        title=\"cities-ds\"\n        src=\"/static/0b297882d73556c02d69b87918fdcb3b/e5715/cities-ds.png\"\n        srcset=\"/static/0b297882d73556c02d69b87918fdcb3b/a6d36/cities-ds.png 650w,\n/static/0b297882d73556c02d69b87918fdcb3b/e5715/cities-ds.png 768w,\n/static/0b297882d73556c02d69b87918fdcb3b/63ff0/cities-ds.png 2887w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></a></p>\n<h2 id=\"how-identity-management-reinforces-security-for-citizens\" style=\"position:relative;\"><a href=\"#how-identity-management-reinforces-security-for-citizens\" aria-label=\"how identity management reinforces security for citizens 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 Identity Management Reinforces Security for Citizens?</h2>\n<p>Invoking the true potential of <a href=\"https://www.loginradius.com/industry-government/\">identity management in the government sector</a> can improve citizens’ experience and eventually play a significant role in reinforcing security. </p>\n<p>Let’s understand how an identity management system like LoginRadius CIAM helps improve the overall security and privacy of citizens: </p>\n<h3 id=\"1-mfa-multi-factor-authentication-and-rba-risk-based-authentication\" style=\"position:relative;\"><a href=\"#1-mfa-multi-factor-authentication-and-rba-risk-based-authentication\" aria-label=\"1 mfa multi factor authentication and rba risk based 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>#1. MFA (multi-factor authentication) and RBA (risk-based authentication)</h3>\n<p><a href=\"https://www.loginradius.com/authentication/\">Authentication</a> in the public sector is crucial, which eventually requires a robust mechanism to ensure user identities remain secured.</p>\n<p>LoginRadius offers multi-factor authentication through SMS, automated phone calls, email, security questions, and authenticator apps, allowing you to customize the user experience. </p>\n<p>Depending on the diverse public sector needs, you can also opt to turn on multi-factor authentication across all customer accounts.</p>\n<p>On the other hand, LoginRadius’ <a href=\"https://www.loginradius.com/blog/identity/risk-based-authentication/\">risk-based authentication</a> is a non-static authentication system that considers the profile (IP address, browser, physical location, and so on) of a consumer requesting access to the system to determine the risk profile associated with that action.</p>\n<p>The risk-based implementation allows diverse web applications to challenge users for additional credentials only when the risk level is appropriate.</p>\n<h3 id=\"2-passwordless-login\" style=\"position:relative;\"><a href=\"#2-passwordless-login\" aria-label=\"2 passwordless login 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. Passwordless Login</h3>\n<p>Passwords can easily be guessed or compromised, especially in the case of elderly individuals who aren’t habitual of maintaining different passwords for different accounts. </p>\n<p>Hence, the chances of account takeovers and compromised identities increase exponentially for elderly individuals. </p>\n<p>With <a href=\"https://www.loginradius.com/passwordless-login/\">passwordless login</a>, you can create a completely frictionless registration and authentication process for citizens, freeing them from the hassle of remembering yet another password.</p>\n<p>User-controlled passwords are vulnerable to phishing, credential stuffing, brute force attacks, corporate account takeover (CATO), and more. </p>\n<p>So, when there is no password to hack in the first place, those vulnerabilities will automatically decrease.</p>\n<p>Passwordless Login uses the same global security standards as password-based logins, plus advanced features for added security.</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>When it comes to customer identity security and user experience, global brands are already leveraging CIAM solutions to thrive in business success. </p>\n<p>And the public sector and government organizations shouldn’t delay a bit in adopting a reliable identity management system that can ensure robust security for citizens’ crucial information. </p>\n<p>Identity management in the government sector can also help resolve issues related to bad user experience. </p>\n<p><a href=\"https://www.loginradius.com/book-a-demo/\"><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 30.307692307692307%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAAAsSAAALEgHS3X78AAABdElEQVQY002RO0/CUBzFG6PtbZWHCAmRmBB5P8vDII9SSC0omog4oAEGjZMO6OKEuLjoJ2Fx0cSBwUQnXZxcHPwux38LJA7nNvfec8+5v1tOCCiwpbbhye2BxbYgBMtgIRVioDRRsARGXxZUzLlEHmehBaesQ4rrEMPViYf2DR9nDGKkChbVICVqsMt1WJI1sHCFwhUsUIFohJH49TxECvRUjhDW2mAbB5iP6hB8hUkhiRPN5KIZYJdrsEYrcCSpmQqMm6/m9ylUhSulY7N5ivROB3L9GOlGF3Ktbc4zuz341UPw/uIk0ESbBjoSGlYIx8BfzjSwVmyCEYEUUmCPa3Bnd+hwC75yC95S05SxbolU/iEbOCFCpDexEfIioTNCNd6Tp6IlMnNuGeeDe3z//OLx5RWj5zFGT2O8fXxh/P4Ja6w6vSEFCnTIlW2YiDzhzX7ATFKojDlvjpBPcDF4QPdyiG5/iE7/BmfXd+hd3VKpCoG8fzxWw2+c+yTpAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"book-a-demo-loginradius\"\n        title=\"book-a-demo-loginradius\"\n        src=\"/static/fcc4c4b5dc38cc4528f99d09480f4eb2/e5715/book-a-demo-loginradius.png\"\n        srcset=\"/static/fcc4c4b5dc38cc4528f99d09480f4eb2/a6d36/book-a-demo-loginradius.png 650w,\n/static/fcc4c4b5dc38cc4528f99d09480f4eb2/e5715/book-a-demo-loginradius.png 768w,\n/static/fcc4c4b5dc38cc4528f99d09480f4eb2/63ff0/book-a-demo-loginradius.png 2887w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></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 29, 2022","updated_date":null,"description":" Identity management has been a game-changer for enterprises for decades as it helps businesses succeed by ensuring the highest level of security and great user experience.  Let’s understand the aspects of leveraging identity management through a reliable customer identity and access management (CIAM) platform for fixing security and usability issues in the public sector.","title":"The Role of Identity Management in Securing Your Citizen’s Data","tags":["digital identity","smart cities","authentication"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.492537313432836,"src":"/static/ded0349745f5f5931dfb105205ffb549/33aa5/citizen-sec.jpg","srcSet":"/static/ded0349745f5f5931dfb105205ffb549/f836f/citizen-sec.jpg 200w,\n/static/ded0349745f5f5931dfb105205ffb549/2244e/citizen-sec.jpg 400w,\n/static/ded0349745f5f5931dfb105205ffb549/33aa5/citizen-sec.jpg 768w","sizes":"(max-width: 768px) 100vw, 768px"}}},"author":{"id":"Yash Rathi","github":"yashrathi29","avatar":null}}}},{"node":{"excerpt":"Introduction It is essential to protect your APIs for a secure experience, and JSON Web Token (JWT) authentication allows you to protect…","fields":{"slug":"/engineering/guest-post/how-to-implement-jwt-authentication-in-deno/"},"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>It is essential to protect your APIs for a secure experience, and <strong>JSON Web Token</strong> (JWT) authentication allows you to protect your APIs so that an unauthorized person will not have access.</p>\n<h2 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</h2>\n<p>This is a hands-on tutorial to follow. To get the most out of it, ensure you have:</p>\n<ul>\n<li>A code editor of your choice</li>\n<li>Basic knowledge of JavaScript/<a href=\"https://www.typescriptlang.org/\">TypeScript</a>.</li>\n<li>Basic knowledge of <a href=\"https://www.mongodb.com/\">MongoDB</a></li>\n<li><a href=\"https://www.postman.com/\">Postman</a> or <a href=\"https://insomnia.rest/\">Insomia</a> installed</li>\n</ul>\n<h2 id=\"what-is-deno\" style=\"position:relative;\"><a href=\"#what-is-deno\" aria-label=\"what is deno 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 Deno?</h2>\n<p><a href=\"https://deno.land/\">Deno</a> is developed in Rust. It is a modern runtime environment for JavaScript/TypeScript and a WebAssembly that uses the Google V8 engine. It is simple and safe. It implements web platform standards and provides web platform capabilities.</p>\n<p>Deno’s features are intended to enhance Node.js’s capabilities. It’s secure by default, with no access to files, networks, or the environment except explicitly enabled. And it supports both JavaScript and TypeScript out of the box.</p>\n<h2 id=\"why-use-deno\" style=\"position:relative;\"><a href=\"#why-use-deno\" aria-label=\"why use deno 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 Use Deno?</h2>\n<p>Deno is a well-thought-out modular system. Apart from its simplicity and high security, there are so many other reasons to use Deno:</p>\n<ul>\n<li>Outside of an async function, you can use await</li>\n<li>No setting is required for TypeScript to work</li>\n<li>There are no dependencies, and it ships as a single executable</li>\n<li>A dependency inspector and a code formatter are built-in</li>\n<li>Packages in Deno are decentralized</li>\n</ul>\n<h2 id=\"what-is-json-web-token\" style=\"position:relative;\"><a href=\"#what-is-json-web-token\" aria-label=\"what is json web token 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 JSON Web Token?</h2>\n<p>JSON Web Token, popularly called JWT, is an open standard that offers a concise and self-contained method for securely transferring data between parties as a JSON object. It holds information in an easy-to-access format for developers and computers; the token's compact size makes it simple to send through URL, POST parameter, or HTTP header. It allows two parties — a client and a server — to share information securely. A secret or public/private key pair is used to digitally sign the information in a JWT. </p>\n<p>Authentication is the primary use of JWT. It is assigned to a user after they sign in to an application, and with the assigned JWT, a user can request other routes.</p>\n<h2 id=\"install-deno\" style=\"position:relative;\"><a href=\"#install-deno\" aria-label=\"install deno 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 Deno</h2>\n<p>Without too many shenanigans, let's start by installing Deno!</p>\n<p>Deno installation in Windows isn't as smooth sailing as on Mac or Linux. Unlike in Node.js, where you run a command on your terminal, Deno in Windows can be installed using PowerShell, Scoop (a command-line installer), or Chocolatey (a package manager). <a href=\"https://deno.land/manual/getting_started/installation\">Click here for the guide on how to install Deno</a>.</p>\n<p>To install Deno with PowerShell, open your PowerShell and run the following command:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">iwr https://deno.land/x/install/install.ps1 -useb | iex</span></code></pre>\n<p>Relax while Deno is being installed. When completed, exit PowerShell and close and reopen a terminal. The new PATH is activated by closing and reopening the terminal. Now that you have installed Deno, let's check the version of Deno.</p>\n<p>To check the version of your installed Deno, run: <code>deno -V</code></p>\n<h2 id=\"project-setup\" style=\"position:relative;\"><a href=\"#project-setup\" aria-label=\"project setup 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>Project Setup</h2>\n<p>With installation out of the way, let us set up your project. Create a folder <code>DenoAPI_JWT_Auth</code>; you can call it any name you choose. Create an <code>app.ts</code> file and a folder <code>src</code> in your folder.</p>\n<p>Inside your <code>src</code> folder, create the following folders: <code>controllers</code>, <code>database</code>, <code>middlewares</code>, <code>routes</code>, <code>schema</code>, and <code>utils</code>.</p>\n<p>Your project directory should look as follows:</p>\n<p><code>DenoAPI_JWT_Auth</code>  </p>\n<p>│\n└─<strong>src</strong><br>\n│   └───controllers<br>\n│   │\n│   └───database<br>\n│   │\n│   └───middlewares<br>\n│   │\n│   └───routes<br>\n│   │\n│   └───schema<br>\n│   │\n│   └───utils<br>\n└─<strong>app.ts</strong>  </p>\n<h2 id=\"create-oak-server\" style=\"position:relative;\"><a href=\"#create-oak-server\" aria-label=\"create oak server 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 Oak Server</h2>\n<p>Next is to create your Oak server. <a href=\"https://oakserver.github.io/oak/\">Oak</a> is a Deno middleware system that provides a router middleware for HTTP servers.</p>\n<p>Go to <code>app.ts</code>, import Application from the Deno Oak URL, create an instance of the application, define your port, and call a middleware, as follows.</p>\n<p><code>app.ts</code></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=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">Application</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;https://deno.land/x/oak/mod.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">app</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Application</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">PORT</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">8080</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">   </span><span class=\"mtk12\">app</span><span class=\"mtk1\">.</span><span class=\"mtk11\">use</span><span class=\"mtk1\">((</span><span class=\"mtk12\">ctx</span><span class=\"mtk1\">, </span><span class=\"mtk12\">next</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\">ctx</span><span class=\"mtk1\">.</span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&#39;Welcome&#39;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk11\">next</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=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk8\">`Application is listening on port: </span><span class=\"mtk4\">${</span><span class=\"mtk12\">PORT</span><span class=\"mtk4\">}</span><span class=\"mtk8\">`</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">app</span><span class=\"mtk1\">.</span><span class=\"mtk11\">listen</span><span class=\"mtk1\">({</span><span class=\"mtk12\">port:PORT</span><span class=\"mtk1\">});</span></span></code></pre>\n<p>Let's quickly run your server: to run the server, use <code>deno run --allow-net app.ts</code> </p>\n<p>Deno will always request permission to use your network. <code>--allow-net</code> gives Deno permission to all network calls.</p>\n<p>You should see <code>Application is listening on port: 8080</code></p>\n<p>Now, in your <code>routes</code> folder, create a file called <code>allRoutes.ts</code>, and set up your router by importing <code>Router</code> from the oak URL, then create an instance of the router and export the default router.</p>\n<p><code>routes.allRoutes.ts</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">Router</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;https://deno.land/x/oak/mod.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">router</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Router</span><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\">router</span><span class=\"mtk1\">;</span></span></code></pre>\n<p>Moving on, you need to modify <code>app.ts</code>. So, go to <code>app.ts</code> and import the router. Let the app use <code>router.routes()</code> and <code>router.allowedMethods()</code> methods, then remove the middleware, so it doesn't overshadow the imported routes. The <code>allowedMethods()</code> tells Deno to include all routes by your router.</p>\n<p><code>app.ts</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">Application</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;https://deno.land/x/oak/mod.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> </span><span class=\"mtk12\">router</span><span class=\"mtk1\"> </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;./src/routes/allRoutes.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">app</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Application</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">PORT</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">8080</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">app</span><span class=\"mtk1\">.</span><span class=\"mtk11\">use</span><span class=\"mtk1\">(</span><span class=\"mtk12\">router</span><span class=\"mtk1\">.</span><span class=\"mtk11\">routes</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">app</span><span class=\"mtk1\">.</span><span class=\"mtk11\">use</span><span class=\"mtk1\">(</span><span class=\"mtk12\">router</span><span class=\"mtk1\">.</span><span class=\"mtk11\">allowedMethods</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk8\">`Application is listening on port: </span><span class=\"mtk4\">${</span><span class=\"mtk12\">PORT</span><span class=\"mtk4\">}</span><span class=\"mtk8\">`</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">app</span><span class=\"mtk1\">.</span><span class=\"mtk11\">listen</span><span class=\"mtk1\">({</span><span class=\"mtk12\">port:PORT</span><span class=\"mtk1\">});</span></span></code></pre>\n<p>You can rerun your app with the same command: <code>deno run --allow-net app.ts</code></p>\n<h2 id=\"create-user-data\" style=\"position:relative;\"><a href=\"#create-user-data\" aria-label=\"create 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>Create User Data</h2>\n<p>Now, you need to create user data. But before that, let's connect your application to the MongoDB database.</p>\n<ul>\n<li>Go to your <code>database</code> folder</li>\n<li>Create a file called <code>connectBD.ts</code></li>\n<li>Import MongoClient from the Deno MongoDB URL</li>\n<li>Create an instance of MongoClient</li>\n<li>Connect your database</li>\n<li>Export default</li>\n</ul>\n<p><code>database.connectDB.ts</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">MongoClient</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;https://deno.land/x/mongo@v0.30.0/mod.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk3\">// Connecting to a Mongo Database</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">client</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">MongoClient</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\">dbString</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&quot;DB_String&quot;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">client</span><span class=\"mtk1\">.</span><span class=\"mtk11\">connect</span><span class=\"mtk1\">(</span><span class=\"mtk12\">dbString</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=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Database connected!&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=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">db</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">client</span><span class=\"mtk1\">.</span><span class=\"mtk11\">database</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;deno_auth&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"></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\">db</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span></code></pre>\n<p>With that out of the way, let's create an interface for your database.</p>\n<p>In your <code>schema</code> folder, create a file <code>user.ts</code>, import objectId from deno MongoDB URL, then define and export your schema.</p>\n<p><code>schema.user.ts</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> {</span><span class=\"mtk12\">ObjectId</span><span class=\"mtk1\">} </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;https://deno.land/x/mongo@v0.30.0/mod.ts&quot;</span><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\">interface</span><span class=\"mtk1\"> </span><span class=\"mtk10\">UserSchema</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=\"mtk10\">ObjectId</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">username</span><span class=\"mtk1\">: </span><span class=\"mtk10\">string</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=\"mtk10\">string</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  }</span></span></code></pre>\n<p>Let's play with some logic: go to your <code>controllers</code> folder, and create a file called <code>users.ts</code>. In the file, import your database and UserSchema.</p>\n<p>It's not a good practice to store your password in plain text for security reasons. To has your password, let's import bcrypt from the deno bcrypt URL.</p>\n<p>So, create a function called <code>signup</code> that takes username and password. Take the user details from the request body, hash the password, and save them to your database.</p>\n<p><code>controllers.users.ts</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> </span><span class=\"mtk12\">db</span><span class=\"mtk1\"> </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../database/connectBD.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> </span><span class=\"mtk4\">*</span><span class=\"mtk1\"> </span><span class=\"mtk15\">as</span><span class=\"mtk1\"> </span><span class=\"mtk12\">bcrypt</span><span class=\"mtk1\"> </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;https://deno.land/x/bcrypt/mod.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">UserSchema</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../schema/user.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">Users</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">db</span><span class=\"mtk1\">.</span><span class=\"mtk11\">collection</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">UserSchema</span><span class=\"mtk1\">&gt;(</span><span class=\"mtk8\">&quot;users&quot;</span><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\">signup</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">async</span><span class=\"mtk1\">({</span><span class=\"mtk12\">request</span><span class=\"mtk1\">, </span><span class=\"mtk12\">response</span><span class=\"mtk1\">}:{</span><span class=\"mtk12\">request</span><span class=\"mtk1\">:</span><span class=\"mtk10\">any</span><span class=\"mtk1\">;</span><span class=\"mtk12\">response</span><span class=\"mtk1\">:</span><span class=\"mtk10\">any</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\">username</span><span class=\"mtk1\">, </span><span class=\"mtk12\">password</span><span class=\"mtk1\">} = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">request</span><span class=\"mtk1\">.</span><span class=\"mtk11\">body</span><span class=\"mtk1\">().</span><span class=\"mtk12\">value</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\">salt</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">bcrypt</span><span class=\"mtk1\">.</span><span class=\"mtk11\">genSalt</span><span class=\"mtk1\">(</span><span class=\"mtk7\">8</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\">hashedPassword</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">bcrypt</span><span class=\"mtk1\">.</span><span class=\"mtk11\">hash</span><span class=\"mtk1\">(</span><span class=\"mtk12\">password</span><span class=\"mtk1\">, </span><span class=\"mtk12\">salt</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\">_id</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">Users</span><span class=\"mtk1\">.</span><span class=\"mtk11\">insertOne</span><span class=\"mtk1\">({</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">username</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">password:hashedPassword</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      });</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">status</span><span class=\"mtk1\"> =</span><span class=\"mtk7\">201</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> = {</span><span class=\"mtk12\">message:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;User created&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">userId:_id</span><span class=\"mtk1\">, </span><span class=\"mtk12\">user:username</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>Now, head over to <code>allRoutes.ts</code> in your <code>routes</code> folder, import the <code>signup</code> function from the controller, and create a POST route for <code>signup</code>, as follows.</p>\n<p><code>routes.allRoutes.ts</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">import { Router } from &quot;https://deno.land/x/oak/mod.ts&quot;;</span>\n<span class=\"grvsc-line\">import {signup} from &quot;../controllers/users.ts&quot;;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">const router = new Router();</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">//User routes</span>\n<span class=\"grvsc-line\">router.post(&quot;/api/signup&quot;, signup)</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">export default router;</span></code></pre>\n<h2 id=\"create-authenticate-user-route\" style=\"position:relative;\"><a href=\"#create-authenticate-user-route\" aria-label=\"create authenticate user 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>Create Authenticate User route</h2>\n<p>Next, create an authentication route that authenticates your user route. The latest version of Deno does not allow a string as a secret key but accepts a cryptokey generated from a <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/generateKey\">Web Crypto API</a> with the <code>generatekey()</code> method of the <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto\">SubtleCrypto</a> interface.</p>\n<p>So, head over to your <code>utils</code> folder, create a file called <code>apiKey.ts</code>,  and in the file, generate your key and export it, as follows.</p>\n<p><code>utils.apiKey.ts</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"8\"><code class=\"grvsc-code\"><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\">key</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">crypto</span><span class=\"mtk1\">.</span><span class=\"mtk12\">subtle</span><span class=\"mtk1\">.</span><span class=\"mtk11\">generateKey</span><span class=\"mtk1\">(</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    { </span><span class=\"mtk12\">name:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;HMAC&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">hash:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;SHA-512&quot;</span><span class=\"mtk1\"> },</span></span>\n<span class=\"grvsc-line\"><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=\"mtk8\">&quot;sign&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;verify&quot;</span><span class=\"mtk1\">],</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  );</span></span></code></pre>\n<p>Now that you have successfully created your key, you can create a user authentication route so that every user that logs in will get authenticated.</p>\n<p>Head over to <code>user.ts</code> in your controller, import the API key, create a <code>signin</code> function, and write some validation logic to validate that the user exists in your database. If validation is successful, you create a token to authenticate the user. </p>\n<h2 id=\"using-jwt-to-authenticate-a-user\" style=\"position:relative;\"><a href=\"#using-jwt-to-authenticate-a-user\" aria-label=\"using jwt to authenticate a 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>Using JWT to Authenticate a User</h2>\n<p>Now, let's import Deno JWT (djwt) <code>create</code> function from the URL to create a token. When a user logs in, take the id and username, pass the payload into the JWT <code>create</code> function, generate a token, and use the token to authenticate the user.</p>\n<p><code>controllers.users.ts</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> </span><span class=\"mtk12\">db</span><span class=\"mtk1\"> </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../database/connectDB.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> </span><span class=\"mtk4\">*</span><span class=\"mtk1\"> </span><span class=\"mtk15\">as</span><span class=\"mtk1\"> </span><span class=\"mtk12\">bcrypt</span><span class=\"mtk1\"> </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;https://deno.land/x/bcrypt/mod.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">UserSchema</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../schema/user.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">create</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;https://deno.land/x/djwt@v2.4/mod.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">key</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../utils/apiKey.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">Users</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">db</span><span class=\"mtk1\">.</span><span class=\"mtk11\">collection</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">UserSchema</span><span class=\"mtk1\">&gt;(</span><span class=\"mtk8\">&quot;users&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk3\">//create a user</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">signup</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">async</span><span class=\"mtk1\">({</span><span class=\"mtk12\">request</span><span class=\"mtk1\">, </span><span class=\"mtk12\">response</span><span class=\"mtk1\">}:{</span><span class=\"mtk12\">request</span><span class=\"mtk1\">:</span><span class=\"mtk10\">any</span><span class=\"mtk1\">;</span><span class=\"mtk12\">response</span><span class=\"mtk1\">:</span><span class=\"mtk10\">any</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\">username</span><span class=\"mtk1\">, </span><span class=\"mtk12\">password</span><span class=\"mtk1\">} = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">request</span><span class=\"mtk1\">.</span><span class=\"mtk11\">body</span><span class=\"mtk1\">().</span><span class=\"mtk12\">value</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\">salt</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">bcrypt</span><span class=\"mtk1\">.</span><span class=\"mtk11\">genSalt</span><span class=\"mtk1\">(</span><span class=\"mtk7\">8</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\">hashedPassword</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">bcrypt</span><span class=\"mtk1\">.</span><span class=\"mtk11\">hash</span><span class=\"mtk1\">(</span><span class=\"mtk12\">password</span><span class=\"mtk1\">, </span><span class=\"mtk12\">salt</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\">_id</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">Users</span><span class=\"mtk1\">.</span><span class=\"mtk11\">insertOne</span><span class=\"mtk1\">({</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">username</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">password:hashedPassword</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      });</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">status</span><span class=\"mtk1\"> =</span><span class=\"mtk7\">201</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> = {</span><span class=\"mtk12\">message:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;User created&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">userId:_id</span><span class=\"mtk1\">, </span><span class=\"mtk12\">user:username</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=\"mtk3\">//sign in a user</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">signin</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">async</span><span class=\"mtk1\"> ({</span><span class=\"mtk12\">request</span><span class=\"mtk1\">, </span><span class=\"mtk12\">response</span><span class=\"mtk1\">}:{</span><span class=\"mtk12\">request</span><span class=\"mtk1\">:</span><span class=\"mtk10\">any</span><span class=\"mtk1\">; </span><span class=\"mtk12\">response</span><span class=\"mtk1\">:</span><span class=\"mtk10\">any</span><span class=\"mtk1\">}) </span><span class=\"mtk4\">=&gt;</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\">body</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">request</span><span class=\"mtk1\">.</span><span class=\"mtk11\">body</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\">username</span><span class=\"mtk1\">, </span><span class=\"mtk12\">password</span><span class=\"mtk1\">} = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">body</span><span class=\"mtk1\">.</span><span class=\"mtk12\">value</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\">user</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">Users</span><span class=\"mtk1\">.</span><span class=\"mtk11\">findOne</span><span class=\"mtk1\">({</span><span class=\"mtk12\">username</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\">user</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">404</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> = {</span><span class=\"mtk12\">message:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">`user &quot;</span><span class=\"mtk4\">${</span><span class=\"mtk12\">username</span><span class=\"mtk4\">}</span><span class=\"mtk8\">&quot; not found`</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>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">confirmPassword</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">bcrypt</span><span class=\"mtk1\">.</span><span class=\"mtk11\">compare</span><span class=\"mtk1\">(</span><span class=\"mtk12\">password</span><span class=\"mtk1\">, </span><span class=\"mtk12\">user</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=\"mtk15\">if</span><span class=\"mtk1\">(!</span><span class=\"mtk12\">confirmPassword</span><span class=\"mtk1\">){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">404</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> = {</span><span class=\"mtk12\">message:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Incorrect password&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>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk3\">//authenticate a user</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">payload</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=\"mtk12\">user</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\">name:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">username</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\">jwt</span><span class=\"mtk1\"> =  </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk11\">create</span><span class=\"mtk1\">({ </span><span class=\"mtk12\">alg:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;HS512&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">typ:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;JWT&quot;</span><span class=\"mtk1\"> }, { </span><span class=\"mtk12\">payload</span><span class=\"mtk1\"> }, </span><span class=\"mtk12\">key</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\">jwt</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">status</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">200</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> = {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">userId:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">user</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\">username:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">user</span><span class=\"mtk1\">.</span><span class=\"mtk12\">username</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 class=\"mtk12\">jwt</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=\"mtk15\">else</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">status</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">500</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> = {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">message:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;internal server error&quot;</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></code></pre>\n<p>So far, you have progressed well. The next thing is to import your <code>signin</code> function in the routes and create a post request for it, as follows.</p>\n<p><code>routes.allRoutes.ts</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">Router</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;https://deno.land/x/oak/mod.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> {</span><span class=\"mtk12\">signup</span><span class=\"mtk1\">, </span><span class=\"mtk12\">signin</span><span class=\"mtk1\">} </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../controllers/users.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">router</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Router</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">//User routes</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">router</span><span class=\"mtk1\">.</span><span class=\"mtk11\">post</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/signup&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">signup</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      .</span><span class=\"mtk11\">post</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/signin&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">signin</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\">export</span><span class=\"mtk1\"> </span><span class=\"mtk15\">default</span><span class=\"mtk1\"> </span><span class=\"mtk12\">router</span><span class=\"mtk1\">;</span></span></code></pre>\n<p>Congratulations on making it this far! You are through with the authentication route. Now, you can register a user, sign in, and authenticate the user. </p>\n<p>You need to create your todo CRUD API and protect the routes so that a random person will not be able to access your route except when authenticated.</p>\n<p>Go to your <code>schema</code> folder, and create a file <code>task.ts</code>. In the file, create your tasks interface and export it.</p>\n<h2 id=\"create-todo-route\" style=\"position:relative;\"><a href=\"#create-todo-route\" aria-label=\"create todo 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>Create Todo Route</h2>\n<p><code>schema.task.ts</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"11\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk4\">interface</span><span class=\"mtk1\"> </span><span class=\"mtk10\">TaskSchema</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">name</span><span class=\"mtk1\">: </span><span class=\"mtk10\">string</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">isCompleted</span><span class=\"mtk1\">: </span><span class=\"mtk10\">boolean</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  } </span></span></code></pre>\n<p>After successfully creating the task interface, move to our controller, create a file <code>tasks.ts</code>, and import the database, schema, and object Id. Then write the logic for our todo CRUD API.</p>\n<p><code>controllers.tasks.ts</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"12\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> </span><span class=\"mtk12\">db</span><span class=\"mtk1\"> </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../database/connectDB.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">TaskSchema</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../schema/task.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> {</span><span class=\"mtk12\">ObjectId</span><span class=\"mtk1\">} </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;https://deno.land/x/mongo@v0.30.0/mod.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">tasks</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">db</span><span class=\"mtk1\">.</span><span class=\"mtk11\">collection</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">TaskSchema</span><span class=\"mtk1\">&gt;(</span><span class=\"mtk8\">&quot;tasks&quot;</span><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\">create</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">async</span><span class=\"mtk1\">({</span><span class=\"mtk12\">request</span><span class=\"mtk1\">, </span><span class=\"mtk12\">response</span><span class=\"mtk1\">}:{</span><span class=\"mtk12\">request</span><span class=\"mtk1\">:</span><span class=\"mtk10\">any</span><span class=\"mtk1\">;</span><span class=\"mtk12\">response</span><span class=\"mtk1\">:</span><span class=\"mtk10\">any</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\">name</span><span class=\"mtk1\">, </span><span class=\"mtk12\">isCompleted</span><span class=\"mtk1\">} = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">request</span><span class=\"mtk1\">.</span><span class=\"mtk11\">body</span><span class=\"mtk1\">().</span><span class=\"mtk12\">value</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\">_id</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">tasks</span><span class=\"mtk1\">.</span><span class=\"mtk11\">insertOne</span><span class=\"mtk1\">({</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">name</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">isCompleted</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      });</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> = {</span><span class=\"mtk12\">message:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Task created!!&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">id:_id</span><span class=\"mtk1\">, </span><span class=\"mtk12\">name:name</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Completed:isCompleted</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=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">getTasks</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">async</span><span class=\"mtk1\"> ({</span><span class=\"mtk12\">response</span><span class=\"mtk1\">}:{</span><span class=\"mtk12\">response</span><span class=\"mtk1\">:</span><span class=\"mtk10\">any</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\">allTasks</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">tasks</span><span class=\"mtk1\">.</span><span class=\"mtk11\">find</span><span class=\"mtk1\">({}).</span><span class=\"mtk11\">toArray</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">status</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">200</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> = {</span><span class=\"mtk12\">tasks:allTasks</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=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">getById</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">async</span><span class=\"mtk1\"> ({</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">params</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">response</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">   }:{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">params</span><span class=\"mtk1\">:{</span><span class=\"mtk12\">taskId</span><span class=\"mtk1\">:</span><span class=\"mtk10\">string</span><span class=\"mtk1\">};</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">response</span><span class=\"mtk1\">:</span><span class=\"mtk10\">any</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><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\">taskId</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">params</span><span class=\"mtk1\">.</span><span class=\"mtk12\">taskId</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\">task</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">tasks</span><span class=\"mtk1\">.</span><span class=\"mtk11\">findOne</span><span class=\"mtk1\">({</span><span class=\"mtk12\">_id:</span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">ObjectId</span><span class=\"mtk1\">(</span><span class=\"mtk12\">taskId</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\">task</span><span class=\"mtk1\">){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> = {</span><span class=\"mtk12\">message:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">`no task with Id: </span><span class=\"mtk4\">${</span><span class=\"mtk12\">taskId</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=\"mtk15\">return</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\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">status</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">200</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> = {</span><span class=\"mtk12\">task:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">task</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\">export</span><span class=\"mtk1\"> </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">updateById</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">async</span><span class=\"mtk1\"> ({</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">params</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">request</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">response</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}:{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">params</span><span class=\"mtk1\">:{</span><span class=\"mtk12\">taskId</span><span class=\"mtk1\">:</span><span class=\"mtk10\">string</span><span class=\"mtk1\">};</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">request</span><span class=\"mtk1\">:</span><span class=\"mtk10\">any</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">response</span><span class=\"mtk1\">:</span><span class=\"mtk10\">any</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><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\">taskId</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">params</span><span class=\"mtk1\">.</span><span class=\"mtk12\">taskId</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\">name</span><span class=\"mtk1\">, </span><span class=\"mtk12\">isCompleted</span><span class=\"mtk1\">} = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">request</span><span class=\"mtk1\">.</span><span class=\"mtk11\">body</span><span class=\"mtk1\">().</span><span class=\"mtk12\">value</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\">task</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">tasks</span><span class=\"mtk1\">.</span><span class=\"mtk11\">updateOne</span><span class=\"mtk1\">({</span><span class=\"mtk12\">_id:</span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">ObjectId</span><span class=\"mtk1\">(</span><span class=\"mtk12\">taskId</span><span class=\"mtk1\">)},</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    {</span><span class=\"mtk12\">$set:</span><span class=\"mtk1\">{</span><span class=\"mtk12\">name:name</span><span class=\"mtk1\">, </span><span class=\"mtk12\">isCompleted:isCompleted</span><span class=\"mtk1\">}});</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">status</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">200</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> = {</span><span class=\"mtk12\">message:</span><span class=\"mtk8\">&quot;Updated task&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">task:task</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\">export</span><span class=\"mtk1\"> </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">deleteTask</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">async</span><span class=\"mtk1\"> ({</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">params</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">response</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\">params</span><span class=\"mtk1\">:{</span><span class=\"mtk12\">taskId</span><span class=\"mtk1\">:</span><span class=\"mtk10\">string</span><span class=\"mtk1\">};</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">response</span><span class=\"mtk1\">:</span><span class=\"mtk10\">any</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><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\">taskId</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">params</span><span class=\"mtk1\">.</span><span class=\"mtk12\">taskId</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\">task</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk12\">tasks</span><span class=\"mtk1\">.</span><span class=\"mtk11\">deleteOne</span><span class=\"mtk1\">({</span><span class=\"mtk12\">_id:</span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">ObjectId</span><span class=\"mtk1\">(</span><span class=\"mtk12\">taskId</span><span class=\"mtk1\">)});</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">status</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">200</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> = {</span><span class=\"mtk12\">message:</span><span class=\"mtk8\">&quot;Deleted task&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">task:task</span><span class=\"mtk1\">};</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">};</span></span></code></pre>\n<p>With that out of the way, you need to create your todo CRUD routes. So, head over to <code>allRoutes.ts</code> and import the CRUD functions from the task controllers, then create the routes for our todo, as follows.</p>\n<p><code>routes.allRoutes.ts</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"13\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">Router</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;https://deno.land/x/oak/mod.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> {</span><span class=\"mtk12\">signup</span><span class=\"mtk1\">, </span><span class=\"mtk12\">signin</span><span class=\"mtk1\">} </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../controllers/users.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> {</span><span class=\"mtk12\">create</span><span class=\"mtk1\">, </span><span class=\"mtk12\">getTasks</span><span class=\"mtk1\">, </span><span class=\"mtk12\">getById</span><span class=\"mtk1\">, </span><span class=\"mtk12\">updateById</span><span class=\"mtk1\">, </span><span class=\"mtk12\">deleteTask</span><span class=\"mtk1\">} </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../controllers/tasks.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">router</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Router</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">//User routes</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">router</span><span class=\"mtk1\">.</span><span class=\"mtk11\">post</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/signup&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">signup</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      .</span><span class=\"mtk11\">post</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/signin&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">signin</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">//Task routes</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">router</span><span class=\"mtk1\">.</span><span class=\"mtk11\">post</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/tasks&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">create</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      .</span><span class=\"mtk11\">get</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/tasks&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">getTasks</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      .</span><span class=\"mtk11\">get</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/tasks/:taskId&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">getById</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      .</span><span class=\"mtk11\">patch</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/tasks/:taskId&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">updateById</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      .</span><span class=\"mtk11\">delete</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/tasks/:taskId&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">deleteTask</span><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\">router</span><span class=\"mtk1\">;</span></span></code></pre>\n<h2 id=\"protect-todo-routes\" style=\"position:relative;\"><a href=\"#protect-todo-routes\" aria-label=\"protect todo 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>Protect Todo Routes</h2>\n<p>You need to protect your todo routes so that an unauthorized person will not be able to access them.</p>\n<p>To protect the todo routes, go to your <code>middlewares</code> folder: create a file called <code>isAuthorized.ts</code>, import the <code>verify</code> function from deno JWT URL, import <code>Context</code> from deno, import the secret key you've created, and create the <code>authorized</code> function.</p>\n<p>The authorize function checks if a user has a JWT token, grant the user access if he does, and deny him access if otherwise.</p>\n<p><code>middlewares.isAuthorized.ts</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"14\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">verify</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;https://deno.land/x/djwt@v2.4/mod.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">key</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../utils/apiKey.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">Context</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;https://deno.land/x/oak/mod.ts&quot;</span><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\">authourized</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">async</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">ctx</span><span class=\"mtk1\">: </span><span class=\"mtk10\">Context</span><span class=\"mtk1\">, </span><span class=\"mtk12\">next</span><span class=\"mtk1\">:</span><span class=\"mtk10\">any</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\">try</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\">headers</span><span class=\"mtk1\">: </span><span class=\"mtk10\">Headers</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\">headers</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\">authorization</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">headers</span><span class=\"mtk1\">.</span><span class=\"mtk11\">get</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;Authorization&#39;</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\">authorization</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">ctx</span><span class=\"mtk1\">.</span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">status</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">401</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>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">jwt</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">authorization</span><span class=\"mtk1\">.</span><span class=\"mtk11\">split</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39; &#39;</span><span class=\"mtk1\">)[</span><span class=\"mtk7\">1</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\">jwt</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">ctx</span><span class=\"mtk1\">.</span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">status</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">401</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>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">payload</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk11\">verify</span><span class=\"mtk1\">(</span><span class=\"mtk12\">jwt</span><span class=\"mtk1\">, </span><span class=\"mtk12\">key</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\">payload</span><span class=\"mtk1\">){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">throw</span><span class=\"mtk1\"> </span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Error</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;!payload&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=\"mtk15\">await</span><span class=\"mtk1\"> </span><span class=\"mtk11\">next</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=\"mtk15\">catch</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=\"mtk12\">ctx</span><span class=\"mtk1\">.</span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">status</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">401</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">ctx</span><span class=\"mtk1\">.</span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk12\">body</span><span class=\"mtk1\"> ={</span><span class=\"mtk12\">message:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;You are not authorized to access this route&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>\n<span class=\"grvsc-line\"><span class=\"mtk1\">};</span></span></code></pre>\n<p>To protect your todo routes, import the authorized middleware function from the <code>isAuthorized.ts</code> middleware file and pass the middleware into the todo routes to protect them from unauthorized people.</p>\n<p><code>routes.allRoutes.ts</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"15\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">Router</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;https://deno.land/x/oak/mod.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> {</span><span class=\"mtk12\">signup</span><span class=\"mtk1\">, </span><span class=\"mtk12\">signin</span><span class=\"mtk1\">} </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../controllers/users.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> {</span><span class=\"mtk12\">create</span><span class=\"mtk1\">, </span><span class=\"mtk12\">getTasks</span><span class=\"mtk1\">, </span><span class=\"mtk12\">getById</span><span class=\"mtk1\">, </span><span class=\"mtk12\">updateById</span><span class=\"mtk1\">, </span><span class=\"mtk12\">deleteTask</span><span class=\"mtk1\">} </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../controllers/tasks.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">authourized</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;../middlewares/isAuthorized.ts&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">router</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Router</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">//User routes</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">router</span><span class=\"mtk1\">.</span><span class=\"mtk11\">post</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/signup&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">signup</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      .</span><span class=\"mtk11\">post</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/signin&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">signin</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">//Task routes</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">router</span><span class=\"mtk1\">.</span><span class=\"mtk11\">post</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/tasks&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">authourized</span><span class=\"mtk1\">, </span><span class=\"mtk12\">create</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      .</span><span class=\"mtk11\">get</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/tasks&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">authourized</span><span class=\"mtk1\">, </span><span class=\"mtk12\">getTasks</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      .</span><span class=\"mtk11\">get</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/tasks/:taskId&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">authourized</span><span class=\"mtk1\">, </span><span class=\"mtk12\">getById</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      .</span><span class=\"mtk11\">patch</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/tasks/:taskId&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">authourized</span><span class=\"mtk1\">, </span><span class=\"mtk12\">updateById</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      .</span><span class=\"mtk11\">delete</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/api/tasks/:taskId&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">authourized</span><span class=\"mtk1\">, </span><span class=\"mtk12\">deleteTask</span><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\">router</span><span class=\"mtk1\">;</span></span></code></pre>\n<p>Awesome! Your application is ready, but wait! Don't get too excited yet, relax let's test the application :)</p>\n<p>Below is what your final project directory looks like:</p>\n<p><code>DenoAPI_JWT_Auth</code>  </p>\n<p>│<br>\n└─<strong>src</strong><br>\n│   └───controllers<br>\n│   │      └───users.ts<br>\n│   │      └───tasks.ts<br>\n│   │\n│   └───database<br>\n│   │      └───connectDB.ts<br>\n│   │<br>\n│   └───middlewares<br>\n│   │      └───isAuthorized.ts<br>\n│   │<br>\n│   └───routes<br>\n│   │      └───allRoutes.ts<br>\n│   │\n│   └───schema<br>\n│   │      └───user.ts<br>\n│   │      └───task.ts<br>\n│   │\n│   └───utils<br>\n│   │      └───apiKey.ts<br>\n│   │<br>\n└─<strong>app.ts</strong>  </p>\n<h2 id=\"test-application\" style=\"position:relative;\"><a href=\"#test-application\" aria-label=\"test 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>Test Application</h2>\n<p>Now that your application is ready, you need to test the various routes to ensure they are working. To test the routes, rerun your server with <code>deno run --allow-net app.ts</code>.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 715px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 12.461538461538462%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAYAAABYBvyLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAdElEQVQI102MwQ6CMBQEHwcvkoYYSo1ewCrYtBdBjaFy8/+/aUxqBA6b3UyyI/oWMc8J85gohxHtI7v6RW496hxQl0DRhrS3tSdvFr45OqTqyMx1jtjhw8G/MS6ydyOFvaNOParpkbJNB9Hdr//RC0uSlfQLJDA1TH1m1mYAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"deno run screenshot\"\n        title=\"deno run screenshot\"\n        src=\"/static/60cd74e5ef22e5c2a2926d2314375c0c/d0c0e/apk23wt.png\"\n        srcset=\"/static/60cd74e5ef22e5c2a2926d2314375c0c/a6d36/apk23wt.png 650w,\n/static/60cd74e5ef22e5c2a2926d2314375c0c/d0c0e/apk23wt.png 715w\"\n        sizes=\"(max-width: 715px) 100vw, 715px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Great! The app is running on port:8080. You can now head to the postman to test your routes.</p>\n<h3 id=\"signup-route\" style=\"position:relative;\"><a href=\"#signup-route\" aria-label=\"signup 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>Signup Route</h3>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 326px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 15.644171779141104%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAADCAYAAACTWi8uAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAp0lEQVQI1z2OSw6CQBBEOQkzAwnMj48a3LlBCAhMIFHPIPe/QNl0jIvKq65OVzrSWiPLMhii/inPc1aappBSQikFKQR7QUyShCWF5CyO438etV2Pz76ju7dc4pxDVZbM8+mCZZkx9AOmccIcHuR7hHXD8/3CMo8Ic8C6Bbq/QUmFqKTj5tqgKAoYY2Ct5bKDx+fszZF59p5kaGedhfc0e4+6roiWP/wChBldbhvEbzsAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Sign up\"\n        title=\"Sign up\"\n        src=\"/static/302f2a15bb851bd8f7546c4f2b1d9fcc/ce9b1/d2orbz0.png\"\n        srcset=\"/static/302f2a15bb851bd8f7546c4f2b1d9fcc/ce9b1/d2orbz0.png 326w\"\n        sizes=\"(max-width: 326px) 100vw, 326px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 53.38461538461539%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAYAAAB/Ca1DAAAACXBIWXMAAAsTAAALEwEAmpwYAAABV0lEQVQoz31SW1KEMBDMNfyRvEMISUpqwarVC/jlt+fwOB62nYksLrjrR1dDKtPTMx1xOp2wLAvO5zNqrXDOwVoLozWMMQ165SM03QkhoJYCW18QX98hxnFsIoUOp2nCvMzIeYT3Hj1dvnC4A09wWkK+feLh4wsipURiGTFFJBIvNWN6Ksj8TU1YPKZKLj2k7CCVIpYbFP0zZPcIEwoEO4gpN+TYw5NbHseuY/H42lgq0lvxbWhYHyB4Dy5EuD4iWC6SOwebk+OZ2rtkZgNCSbbbNXSHMbZxpLrZZI+uNRVcwC43XHZ0ZzS9pq+N3kEZR+wgnucZaRhaKMOYEGNsyTpnf8R3TmUT9MHD9JZ2Rk/M0xNjUCAmZHo2icRGCmVIFEpAomACFThrN7dq2+PV6N1xxx0FqTkUhZAKuSTB4BDJmbfmz8Kv+RZ+Q7kcrgLHYP4TOQoyfwPRtTkmgfkB6gAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"trydtxn\"\n        title=\"trydtxn\"\n        src=\"/static/d0bd11adeaf0889aa4a2c39c6b24f1d2/e5715/trydtxn.png\"\n        srcset=\"/static/d0bd11adeaf0889aa4a2c39c6b24f1d2/a6d36/trydtxn.png 650w,\n/static/d0bd11adeaf0889aa4a2c39c6b24f1d2/e5715/trydtxn.png 768w,\n/static/d0bd11adeaf0889aa4a2c39c6b24f1d2/6be49/trydtxn.png 1160w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h3 id=\"sign-in-route\" style=\"position:relative;\"><a href=\"#sign-in-route\" aria-label=\"sign in 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>Sign-in Route</h3>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 313px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 18.530351437699682%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA0ElEQVQY02WP3U6FMBCEeQ9+EwJV4NAY2lNujJwYaO3BG/UGff/n+CwYTdSLyc7MbmYzUVEU5HlOVVX/UJYlWZ4d+79I05Qs4JcfsiJrLd57pOxpmoa2bem6jrZrEfUN4ziitMJog1JD0GfUoJguEw/TBa01ozGYs2G4k0TbxzvbtnHaQ0LYHiqlpO9PCHGLXRzOLdjZYV14fnUs88z6vOL8GvQT69Xz+vKGfbwnKvKCvbYQ4gd1XR9zr5wkSaiXkaTJwb90ShzHgccH//b2u0/dmXqnyZcy6wAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Signin Route URL\"\n        title=\"Signin Route URL\"\n        src=\"/static/4b20b100c466f0c71be5ab91702d6165/80977/fee5d0s.png\"\n        srcset=\"/static/4b20b100c466f0c71be5ab91702d6165/80977/fee5d0s.png 313w\"\n        sizes=\"(max-width: 313px) 100vw, 313px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 55.99999999999999%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAYAAAB/Ca1DAAAACXBIWXMAAAsTAAALEwEAmpwYAAABWklEQVQoz5WSR1LEQAxF+xbsxnbn6DShKFYcgAU7DsQpOO1HcsCD8SxYvJLcln4rtOj7HsMw4Ha7oR96eO+htYGUckIp9WP38DnHp5Rhz6/wL28QpW3hnQfbcRxxuV7Qd+0UGEK4sw7OHWAtjLE4vX/i6eMLIsaIUgpSjogpoSWxcWhRMvl0Cf8LqYNUFnVdoWkasvUGfTd8Tr52BYJLdyHB5w7Z021aUWAzJf4HFrZUseA5aCpZWQejaG77Cg5YBVbWqrUxEOxUVbWwJTR3gXt7SHWi/zWEJVVuWxsNRe1qrbfZHMAdGc6xFG82pEmQ2kM801YTLYO36GmbvFGehbXz0/nV4uJPT0bfwc/IJhImQRYKuSCWDl30yMEh0hkvRz5aAgv/oaIcPc/Q+EhPpMM1e5zTTE/CHTFEN/mTjfNZpHbDCrXrzTwmxYLbrdU2pxW5swuPFsOj+AZ4PDqoXBkAHAAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Signin Route\"\n        title=\"Signin Route\"\n        src=\"/static/6a023599e3ea65da4cf6216c918bfb40/e5715/wncqtya.png\"\n        srcset=\"/static/6a023599e3ea65da4cf6216c918bfb40/a6d36/wncqtya.png 650w,\n/static/6a023599e3ea65da4cf6216c918bfb40/e5715/wncqtya.png 768w,\n/static/6a023599e3ea65da4cf6216c918bfb40/afd0b/wncqtya.png 1153w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Amazing! Now that you have signed up and authenticated a user, the returned token, which shows that the user has been authenticated, can be used to access your todo CRUD APIs.</p>\n<h3 id=\"accessing-the-todo-routes\" style=\"position:relative;\"><a href=\"#accessing-the-todo-routes\" aria-label=\"accessing the todo 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>Accessing the Todo Routes</h3>\n<p>First, let's try accessing your todo routes without the token...</p>\n<h4 id=\"create-task-route\" style=\"position:relative;\"><a href=\"#create-task-route\" aria-label=\"create task 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>Create Task Route</h4>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 320px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 14.0625%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAADCAYAAACTWi8uAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAl0lEQVQI122OQQ7CIBBFexaBgQKCPYBJdyYgEWpNvYTp/VdfaGNXLl7+BDJ/Xue9h3MOxpgDay36vocQ4oBzAaKWHFJKSKX29+Of48QYus+64lkKdC3QtUxrjWEYQIIwXkfkqSDeAuI9YZozUgx45ILlvWB+FZScN1IKW3F3qcvu/N+Q1YvNhoj2lHv+rJWSUM220mbOGb6c6F6YqBgtZQAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Create Task Route URL\"\n        title=\"Create Task Route URL\"\n        src=\"/static/13c5d5fa3ba7c1dba862e9419f2e4134/72799/0bohcxv.png\"\n        srcset=\"/static/13c5d5fa3ba7c1dba862e9419f2e4134/72799/0bohcxv.png 320w\"\n        sizes=\"(max-width: 320px) 100vw, 320px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span>  </p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 41.23076923076923%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAICAYAAAD5nd/tAAAACXBIWXMAAAsTAAALEwEAmpwYAAABLElEQVQoz22SSVLEMAxFcwo2FGTwGA+xU6GruliwYMGaLYfgKlz58+UeKtC9eCUnkaX/pXS1VpRacDgcIOcQAowxUErdoLX+g7zz3iPGCLV9wLx9oUspwTmHlBPqWrG9bCglt8R5nq9Rcqy1d5Hij+/fePj8QSeKcs6IKSBEnpeMtS7IKWJZGNnIx4JRGQxDT4Z/jBgZx/4J2szotFZY1oJ1W7GViBQdFVmEC2EXG27H/pnWEwtKFyXzMLbNRLoNIzs2xpvYVPVn9kr755bTxdmfh8yhG90WcipwH6MNtOXSHGG+3JE42YRJe3Svx2PbbuRy0pkgy+AS9DS17pdizY1snM0nQ9TEIqeoLP8OF2iZMo2jSutg+MESz2TLRCeq1W3Rq+2d5Z6WLd39Atsq51LkvW44AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Create Task Route Access Denied\"\n        title=\"Create Task Route Access Denied\"\n        src=\"/static/eddf56128a683e03a2c63c00e4b6ee0e/e5715/q6eetmg.png\"\n        srcset=\"/static/eddf56128a683e03a2c63c00e4b6ee0e/a6d36/q6eetmg.png 650w,\n/static/eddf56128a683e03a2c63c00e4b6ee0e/e5715/q6eetmg.png 768w,\n/static/eddf56128a683e03a2c63c00e4b6ee0e/4dba2/q6eetmg.png 1151w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>As you can see, when you tried to create a task, you got a message <code>You are not authorized to access this route</code> because a random person did it without a token.</p>\n<p>Now, let's also try accessing the delete by Id route without the token...</p>\n<h4 id=\"delete-task-route\" style=\"position:relative;\"><a href=\"#delete-task-route\" aria-label=\"delete task 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>Delete Task Route</h4>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 503px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 9.74155069582505%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAYAAABYBvyLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAcElEQVQI1y2MURKEIAxDPQ4gfK0rI8VWKYz3P1G2un68SdJ0Mu3CyDnDOYcQApbPAmYGlYJa6fE3lchyhYg87OZZ/h1bLtuGGCOmcV0ge/beY54j1u+KrorWzhfFGB3aGrSrqfH2tx7nYfcOseGUEn4MDUPYmWyg+gAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Delete Task Route URL\"\n        title=\"Delete Task Route URL\"\n        src=\"/static/b7fd865acc41ec16e1086373a2254185/a4078/ngozekb.png\"\n        srcset=\"/static/b7fd865acc41ec16e1086373a2254185/a4078/ngozekb.png 503w\"\n        sizes=\"(max-width: 503px) 100vw, 503px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 53.53846153846153%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAYAAAB/Ca1DAAAACXBIWXMAAAsTAAALEwEAmpwYAAABRElEQVQoz42SS07DMBCGfQfWKPHYjh9JH26UUiSWXKISJ2PFTX/GUzdNaSksPtma+T1Pq2maMO0nHA4H4bWeMQQ450BEv6I1YRh6xH4Fn9+QXt6h+p4NMSHnjN24Q95lYc+JxnFkX0Tg4N77W4rdGZhhwvPHJ56OX1Db9RodO8kaWGdBLCBDUp21Vih3rbXQtq1UZ1hT7mJvG2hy6MIAVTJdHJdHJVDXdXKf/dWXpKs421vG+w7bzQZqKf4vrb5Ockqk0TTNKeA1VXRjf4y0ze+UPJaNaVBt6Web51ZFU7Smct624ORUq2GQefgYkFKal2GIbmZXHpe5msAaxvASredFii1DWw+15kF6/jbl38Xg0XPwJN+BxbXyefjn6pvKohviuZYYypRqHGcgLZQgcnJLhWXAh4tijffh3lLuDPyPoEvNN4L8OOdGI11OAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Delete Task Route Access Denied\"\n        title=\"Delete Task Route Access Denied\"\n        src=\"/static/4359067413cbb62e82e14c00c55ad0e2/e5715/cdkr6ad.png\"\n        srcset=\"/static/4359067413cbb62e82e14c00c55ad0e2/a6d36/cdkr6ad.png 650w,\n/static/4359067413cbb62e82e14c00c55ad0e2/e5715/cdkr6ad.png 768w,\n/static/4359067413cbb62e82e14c00c55ad0e2/4ad3a/cdkr6ad.png 1152w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Your todo CRUD APIs have been protected, and the only way a user can access them is by getting authenticated. Now let's log in again and use the returned token to access the todo routes.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 34.61538461538461%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAHCAYAAAAIy204AAAACXBIWXMAAAsTAAALEwEAmpwYAAABCElEQVQoz3WQTW7DIBCFuUal2gYbzI/t1r+xkiwaWereCyfrXCGH6jlfgZSWRu3i04wej8cwZBxHzPOMw/EIozWKokCe52CMeULv6iNOb5oGuqqh2j306wTiBaXQtS2GYcA0jdBGQ1ktRkqJsix/IaXVeQ7+ssfz9QNP7zcQIQTayqCpNKSSEKWAkD+XOOe+uonc9DEsv/+CUQpaKDCuQLQ2NkTCmAp9339P4oxZlvmaJAm6rsO2bThbLucL1nWFtisKHkYzH0xU1ULXPZTFBTNmX6N3wh7dpbqusSwLTm8n7HaTX4+bPvjol5dkVgjEId4Uaa6maepxEzvis9CTOOAx7K/+P1+onyRMy5qh9V8JAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Tasks\"\n        title=\"Tasks\"\n        src=\"/static/88a4b27df7688f5717979bed2432bdd3/e5715/ehp4zwf.png\"\n        srcset=\"/static/88a4b27df7688f5717979bed2432bdd3/a6d36/ehp4zwf.png 650w,\n/static/88a4b27df7688f5717979bed2432bdd3/e5715/ehp4zwf.png 768w,\n/static/88a4b27df7688f5717979bed2432bdd3/5a3c9/ehp4zwf.png 1169w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>So, you have logged a user in and put the returned Bearer's token in the authorization header. You can access our todo APIs now because, with the bearer's token, you are authorized to access the todo APIs.</p>\n<h4 id=\"create-task-route-1\" style=\"position:relative;\"><a href=\"#create-task-route-1\" aria-label=\"create task route 1 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 Task Route</h4>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 320px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 14.0625%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAADCAYAAACTWi8uAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAl0lEQVQI122OQQ7CIBBFexaBgQKCPYBJdyYgEWpNvYTp/VdfaGNXLl7+BDJ/Xue9h3MOxpgDay36vocQ4oBzAaKWHFJKSKX29+Of48QYus+64lkKdC3QtUxrjWEYQIIwXkfkqSDeAuI9YZozUgx45ILlvWB+FZScN1IKW3F3qcvu/N+Q1YvNhoj2lHv+rJWSUM220mbOGb6c6F6YqBgtZQAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Create Task Route URL\"\n        title=\"Create Task Route URL\"\n        src=\"/static/13c5d5fa3ba7c1dba862e9419f2e4134/72799/y9ilrk9.png\"\n        srcset=\"/static/13c5d5fa3ba7c1dba862e9419f2e4134/72799/y9ilrk9.png 320w\"\n        sizes=\"(max-width: 320px) 100vw, 320px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 52.46153846153846%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAAAsTAAALEwEAmpwYAAABSklEQVQoz51SSU7EMBD0N5Agi/c1MZFGAk4cOHPjxCf4CU8uygmBYRjmwKHUtttd7uqyqLVirjMOhwPaOsUIYwyUUj+gtf6Fdh5DQEgF5vEV+v4ZopQC7z3KVFBvK5Zlwcy1Dx6R5C0XWOScg7X2BDwzJHcR1y/vuHp6g4gxoOSCmFjMwka8zGUlSykzl2HDhGFU6Pse/TAwfmPgfuhuMDKnlIVQSqLME2VXTMmzE8OXNeMO8xX9JXgLRwgpJaxj+5TmSGR0m9f/ITYJlNJ1W9xlXMB+7zgOfYdxHCECh726Rme12dxrib/QFK2/oN0l1AoDaROkMhAP93eYaESgCTEnmpM4C8+5WEgStI52sn3dHpWUpz4xKpK6DGM9RLvg+I9yoTHeIJNI83+dkhzHs6DkVidaFzZm5KmSjA63VynrXGfHZ6cYhq3zD6nJHtrMGTr/AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Create Task Route Access Granted\"\n        title=\"Create Task Route Access Granted\"\n        src=\"/static/a88a8a15e6fe5ce4b8a1d33ffdf1491f/e5715/nbiaskx.png\"\n        srcset=\"/static/a88a8a15e6fe5ce4b8a1d33ffdf1491f/a6d36/nbiaskx.png 650w,\n/static/a88a8a15e6fe5ce4b8a1d33ffdf1491f/e5715/nbiaskx.png 768w,\n/static/a88a8a15e6fe5ce4b8a1d33ffdf1491f/d74fe/nbiaskx.png 1164w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h4 id=\"get-all-tasks-route\" style=\"position:relative;\"><a href=\"#get-all-tasks-route\" aria-label=\"get all tasks 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>Get All Tasks Route</h4>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 313px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 15.015974440894567%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAADCAYAAACTWi8uAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAmklEQVQI11WPyw6CMBRE+ZXSFy3dUDaGRCNuNAEsBb/BRP9/P97WR3AxObkzyWRuobWGVgpVVcEY86eUlWUJxhg455nfWwiRtfUSC9+2uD8fOB33udQ5h7qu4ZsGShv0hx4xBlzOI67TgDBPmIYRcb1hIc10LyGQH9B1OxTGWHjfwlHJdp21Ni8UXPzWJin6JlESFfGdfTwp8QK/2l13kFg0mQAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Get All Tasks Route\"\n        title=\"Get All Tasks Route\"\n        src=\"/static/99aa3aea1516970dab8b17908f446500/80977/zosrr9u.png\"\n        srcset=\"/static/99aa3aea1516970dab8b17908f446500/80977/zosrr9u.png 313w\"\n        sizes=\"(max-width: 313px) 100vw, 313px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 53.69230769230769%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAYAAAB/Ca1DAAAACXBIWXMAAAsTAAALEwEAmpwYAAABXElEQVQoz52TS07EMBBEfQt2+Nf+O4nRLGYNey7CCTgdVyu6E0Ki0WiEWDzFTsflqm5F5ZwxxsD1el1ZxoKUEkrJkJqwr0s+3q3UhkLPcO+fePr4gh6vUL119HlCbW0Vu1wGpt4wTTN676h9gQ8ZxhjG3kFDU4FZ3mB8hJpYTITGVFmooLeMVhMq03hdakbKETmFB3h2H0HeQ5VaUNhN44MxeHhyIPKM+yUIXAvr++N5sNW9d1BbFAPNWGux7yXOtj+QvXMO9gbjiJ+01tU8szvuWW2VIzZEHkiMEV4+/Llkv0jEgtQygWIAcVwfCS52UFk2wRC4ELlnPJyZp9kzr1O8cXugtYZh9AmjedJ2u1A5Pkgpo85jFUzSE+7F7uyv7C1REk0cltrR2FkKhMiiu0N7x+WZ/TvvZTgkgnYT7PMa9+zw3MNHSGxpnfwQyrktchsXvPSKwg7J/V/wG61TOtgzzQC7AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Get All Tasks Route Access Granted\"\n        title=\"Get All Tasks Route Access Granted\"\n        src=\"/static/70d1e40746853de6d2585d1309a369ed/e5715/zxkgmsm.png\"\n        srcset=\"/static/70d1e40746853de6d2585d1309a369ed/a6d36/zxkgmsm.png 650w,\n/static/70d1e40746853de6d2585d1309a369ed/e5715/zxkgmsm.png 768w,\n/static/70d1e40746853de6d2585d1309a369ed/105d8/zxkgmsm.png 1170w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h4 id=\"get-task-by-id-route\" style=\"position:relative;\"><a href=\"#get-task-by-id-route\" aria-label=\"get task by id 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>Get Task By Id Route</h4>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 503px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 9.74155069582505%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAYAAABYBvyLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAcElEQVQI1y2MURKEIAxDPQ4gfK0rI8VWKYz3P1G2un68SdJ0Mu3CyDnDOYcQApbPAmYGlYJa6fE3lchyhYg87OZZ/h1bLtuGGCOmcV0ge/beY54j1u+KrorWzhfFGB3aGrSrqfH2tx7nYfcOseGUEn4MDUPYmWyg+gAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Get Task By Id Route\"\n        title=\"Get Task By Id Route\"\n        src=\"/static/b7fd865acc41ec16e1086373a2254185/a4078/hph0xmy.png\"\n        srcset=\"/static/b7fd865acc41ec16e1086373a2254185/a4078/hph0xmy.png 503w\"\n        sizes=\"(max-width: 503px) 100vw, 503px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 46.61538461538461%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAYAAAAywQxIAAAACXBIWXMAAAsTAAALEwEAmpwYAAABPUlEQVQoz3VSy04DMQzMXyAuzeblZF/JtlXZcuCIxIE7f8Cdb+DDBztl2W1VDiNblj3jjKNKKZj2E06nE+Z5rng+n3E4HNB1HYgIzjl4768QQoDj2LYt+n6Ae/mAf/2EKnkEBcIwDihTqcjTReR4PHJzj5QSYoyVRAQkCulfzoL67QsP799Q+5Ix8JBxFsYKDBqG5VyaJcqGxnC9aSqkJmTGNGtt94ieHJTlZhmQogxtIUP2l2ipSS5CXd9V8aXufKhPV1qvKgu2w7ciS11rvfbXqKF3O6iBjRfFQBcQ5/dIFiJ5TYh8qMjH4X5HHi54WBphfYI6z0/IOddrtUwul5U8yRB7dW9jK34zxMuai+c+giITSpOniDRkjInQsWIK7sq7rRW39qzQLGCglj8W+5G34y/i3b8e/ufp1o4fUkQBnvDjL70AAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Get Task By Id Route Access Granted\"\n        title=\"Get Task By Id Route Access Granted\"\n        src=\"/static/8a8588a75ce26b99cd275e357b924e0f/e5715/get-task-by-id.png\"\n        srcset=\"/static/8a8588a75ce26b99cd275e357b924e0f/a6d36/get-task-by-id.png 650w,\n/static/8a8588a75ce26b99cd275e357b924e0f/e5715/get-task-by-id.png 768w,\n/static/8a8588a75ce26b99cd275e357b924e0f/e6c84/get-task-by-id.png 1148w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Feel free to test the other routes to see how things work.</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've built a todo CRUD API and protected the routes from unauthorized access using JSON Web Token (JWT). You have learned how to create an Oak server in Deno, connect MongoDB, implement JWT authentication, as well as create and authenticate CRUD routes in a Deno application. </p>\n<p><a href=\"https://github.com/LoginRadius/engineering-blog-samples/tree/master/Deno/denoAPI_JWT_Auth\">The code for this tutorial is available here</a> on Github. Feel free to clone and extend the features of the application.</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 .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n</style>","frontmatter":{"date":"July 28, 2022","updated_date":null,"description":"In this hands-on tutorial, you'll learn from scratch how to implement JWT authentication for CRUD APIs in Deno.","title":"How to Implement JWT Authentication for CRUD APIs in Deno","tags":["JWT","Deno","Authentication"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/4d526ec8bb1f9453095b950dfc3c462d/ee604/jwt-authentication-with-deno.png","srcSet":"/static/4d526ec8bb1f9453095b950dfc3c462d/69585/jwt-authentication-with-deno.png 200w,\n/static/4d526ec8bb1f9453095b950dfc3c462d/497c6/jwt-authentication-with-deno.png 400w,\n/static/4d526ec8bb1f9453095b950dfc3c462d/ee604/jwt-authentication-with-deno.png 800w,\n/static/4d526ec8bb1f9453095b950dfc3c462d/f3583/jwt-authentication-with-deno.png 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Ekekenta Odionyenfe Clinton","github":"icode247","avatar":null}}}},{"node":{"excerpt":"Introduction Amazon’s sub-par data management story about its retail platform, if anything, is  a cautionary tale . The lapses in…","fields":{"slug":"/identity/data-privacy-immediate-enterprise-priority/"},"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>Amazon’s sub-par data management story about its retail platform, if anything, is <a rel=\"nofollow\" href=\"https://www.wired.com/story/amazon-failed-to-protect-your-data-investigation/\"> a cautionary tale </a>. The lapses in understanding how and where data is stored had severely affected how information is managed and secured. In turn, it caused security shortfalls and unnecessary privileged access that rogue employees and sellers had exploited.</p>\n<h2 id=\"privacy-and-security-programs-are-not-just-cost-centers\" style=\"position:relative;\"><a href=\"#privacy-and-security-programs-are-not-just-cost-centers\" aria-label=\"privacy and security programs are not just cost centers 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>Privacy and Security Programs Are Not Just Cost Centers</h2>\n<p>The opinionated notion of thinking of <a href=\"https://www.loginradius.com/security/\">data security</a> and privacy programs as cost centers has to be questioned and rethought. While such programs do not seemingly contribute to the profits generated by an enterprise, the adverse effects on the topline when such programs fail are visible in too many examples, mostly in terms of lost consumer loyalty and revenue growth. Inversely, data privacy and security today are fundamental to building and operating a successful enterprise that is sustainable in the long term.</p>\n<p>Overall, security and privacy are interdependent. Accordingly, enterprise leaders should support such programs as not something to be performed but a priority to be managed with appropriate investments of capital and resources.</p>\n<p>An enterprise’s good track record with information security and <a href=\"https://www.loginradius.com/blog/identity/digital-privacy-best-practices/\">consumer-focused privacy management</a> can heighten brand value and strengthen market positioning in the current business landscape. Consumers, who have significantly been affected by data breaches, are concerned about what data they share and with whom, as data — either personal or transactional — is ever becoming critical to how consumers live and businesses operate.</p>\n<p>In this new paradigm, the amount of data is also growing exponentially. This phenomenon is making the data management practices and technologies that was widely used a few years ago ineffective, necessitating enterprises to rethink data management strategies and deploy emerging technologies to prepare for and overcome challenges.</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>All this implies that data management programs have to consider information security and consumer data privacy as fundamental to their success and contribute to an enterprise's topline.</p>\n<p>But, how can enterprise leaders navigate this paradigm shift?</p>\n<p>In my short yet insightful eBook on data privacy, enterprise leaders will get in-depth insights and much-needed perspectives on managing data security and privacy.</p>\n<iframe type=\"text/html\" sandbox=\"allow-scripts allow-same-origin allow-popups\" width=\"336\" height=\"550\" frameborder=\"0\" allowfullscreen style=\"max-width:100%\" src=\"https://read.amazon.in/kp/card?asin=B0B5XPD468&preview=inline&linkCode=kpe&ref_=cm_sw_r_kb_dp_0DF4A46STSXK732QTDAE\" ></iframe>\n<p>The chapters are as follows:</p>\n<ul>\n<li><strong>Chapter I</strong> examines the evolutions of the data economy and how it's affecting business operations, growth, and sustainability</li>\n<li><strong>Chapter II</strong> explains the importance of data privacy and why enterprises need to rethink their approach to data management</li>\n<li><strong>Chapter III</strong> discusses how enterprises can effectively tackle compliance challenges with emerging data regulations</li>\n<li><strong>Chapter IV</strong> helps enterprise leaders understand the future of enterprises dealing with more and more data</li>\n</ul>\n<p>In detail, I have organized the eBook into chapters mentioned above in addition to an Executive Summary intended for senior executives for a brief overview.</p>\n<p><a href=\"https://www.loginradius.com/book-a-demo/\"><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 30.307692307692307%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAAAsSAAALEgHS3X78AAABdElEQVQY002RO0/CUBzFG6PtbZWHCAmRmBB5P8vDII9SSC0omog4oAEGjZMO6OKEuLjoJ2Fx0cSBwUQnXZxcHPwux38LJA7nNvfec8+5v1tOCCiwpbbhye2BxbYgBMtgIRVioDRRsARGXxZUzLlEHmehBaesQ4rrEMPViYf2DR9nDGKkChbVICVqsMt1WJI1sHCFwhUsUIFohJH49TxECvRUjhDW2mAbB5iP6hB8hUkhiRPN5KIZYJdrsEYrcCSpmQqMm6/m9ylUhSulY7N5ivROB3L9GOlGF3Ktbc4zuz341UPw/uIk0ESbBjoSGlYIx8BfzjSwVmyCEYEUUmCPa3Bnd+hwC75yC95S05SxbolU/iEbOCFCpDexEfIioTNCNd6Tp6IlMnNuGeeDe3z//OLx5RWj5zFGT2O8fXxh/P4Ja6w6vSEFCnTIlW2YiDzhzX7ATFKojDlvjpBPcDF4QPdyiG5/iE7/BmfXd+hd3VKpCoG8fzxWw2+c+yTpAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"book-a-demo-loginradius\"\n        title=\"book-a-demo-loginradius\"\n        src=\"/static/fcc4c4b5dc38cc4528f99d09480f4eb2/e5715/book-a-demo-loginradius.png\"\n        srcset=\"/static/fcc4c4b5dc38cc4528f99d09480f4eb2/a6d36/book-a-demo-loginradius.png 650w,\n/static/fcc4c4b5dc38cc4528f99d09480f4eb2/e5715/book-a-demo-loginradius.png 768w,\n/static/fcc4c4b5dc38cc4528f99d09480f4eb2/63ff0/book-a-demo-loginradius.png 2887w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></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 27, 2022","updated_date":null,"description":"In the past ten years, the rise of privacy-conscious consumers and emerging data regulations have compelled enterprises to prioritize their data management programs. Read more to learn how data privacy has become an enterprise priority.","title":"Why is Data Privacy an Immediate Enterprise Priority?","tags":["data privacy","enterprises","regulations"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.342281879194631,"src":"/static/77d3a9854f69435d10d4960b59e05fbd/33aa5/dg-privacy.jpg","srcSet":"/static/77d3a9854f69435d10d4960b59e05fbd/f836f/dg-privacy.jpg 200w,\n/static/77d3a9854f69435d10d4960b59e05fbd/2244e/dg-privacy.jpg 400w,\n/static/77d3a9854f69435d10d4960b59e05fbd/33aa5/dg-privacy.jpg 768w","sizes":"(max-width: 768px) 100vw, 768px"}}},"author":{"id":"Rakesh Soni","github":"oyesoni","avatar":"rakesh-soni.jpg"}}}}]},"markdownRemark":{"excerpt":"Identity is evolving, and developers are at the forefront of this transformation. Every day brings a new learning—adapting to new standards…","fields":{"slug":"/identity/developer-first-identity-provider-loginradius/"},"html":"<p>Identity is evolving, and developers are at the forefront of this transformation. Every day brings a new learning—adapting to new standards and refining approaches to building secure, seamless experiences.</p>\n<p>We’re here to support developers on that journey. We know how important simplicity, efficiency, and well-structured documentation are when working with identity and access management solutions. That’s why we’ve redesigned the <a href=\"https://www.loginradius.com/\">LoginRadius website</a>—to be faster, more intuitive, and developer-first in every way.</p>\n<p>The goal? Having them spend less time searching and more time building.</p>\n<h2 id=\"whats-new-and-improved-on-the-loginradius-website\" style=\"position:relative;\"><a href=\"#whats-new-and-improved-on-the-loginradius-website\" aria-label=\"whats new and improved on the loginradius website 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’s New and Improved on the LoginRadius Website?</h2>\n<p>LoginRadius’ vision is to give developers a product that simplifies identity management so they can focus on building, deploying, and scaling their applications. To enhance this experience, we’ve spent the last few months redesigning our interface— making navigation more intuitive and reassuring that essential resources are easily accessible.</p>\n<p>Here’s a closer look at what’s new and why it’s important:</p>\n<h3 id=\"a-developer-friendly-dark-theme\" style=\"position:relative;\"><a href=\"#a-developer-friendly-dark-theme\" aria-label=\"a developer friendly dark theme 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 Developer-Friendly Dark Theme</h3>\n<p><img src=\"/f46881583c7518a93bb24e94c32320de/a-developer-friendly-dark-theme.webp\" alt=\"This image shows how LoginRadius offers several authentication methods like traditional login, social login, passwordless login, passkeys and more in a dark mode.\">    </p>\n<p>Developers spend long hours working in dark-themed IDEs and terminals, so we’ve designed the LoginRadius experience to be developer-friendly and align with that preference.</p>\n<p>The new dark mode reduces eye strain, enhances readability, and provides a seamless transition between a coding environment and our platform. Our new design features a clean, modern aesthetic with a consistent color scheme and Barlow typography, ensuring better readability. High-quality graphics and icons are thoughtfully placed to enhance the content without adding visual clutter.</p>\n<p>So, whether you’re navigating our API docs or configuring authentication into your system, our improved interface will make those extended development hours more comfortable and efficient.</p>\n<h3 id=\"clear-categorization-for-loginradius-capabilities\" style=\"position:relative;\"><a href=\"#clear-categorization-for-loginradius-capabilities\" aria-label=\"clear categorization for loginradius capabilities 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>Clear Categorization for LoginRadius Capabilities</h3>\n<p><img src=\"/e5358b82be414940f3fb146013845933/capabilities.webp\" alt=\"This image shows a breakdown of all the LoginRadius CIAM capabilities, including authentication, security, UX, scalability and multi-brand management.\"></p>\n<p>We’ve restructured our website to provide a straightforward breakdown of our customer identity and access management platform capabilities, helping you quickly find what you need:</p>\n<ul>\n<li>Authentication: Easily understand <a href=\"https://www.loginradius.com/blog/identity/authentication-option-for-your-product/\">how to choose the right login method</a>, from traditional passwords and OTPs to social login, federated SSO, and passkeys with few lines of code.</li>\n<li>Security: Implement no-code security features like bot detection, IP throttling, breached password alerts, DDoS protection, and adaptive MFA to safeguard user accounts.</li>\n<li>User Experience: Leverage AI builder, hosted pages, and drag-and-drop workflows to create smooth, branded sign-up and login experiences.</li>\n<li>High Performance &#x26; Scalability: Confidently scale with sub-100ms API response times, 100% uptime, 240K+ RPS, and 28+ global data center regions.</li>\n<li>Multi-Brand Management: Efficiently manage multiple identity apps, choosing isolated or shared data stores based on your brand’s unique needs.</li>\n</ul>\n<p>This structured layout ensures you can quickly understand each capability and how it integrates into your identity ecosystem.</p>\n<h3 id=\"developer-first-navigation\" style=\"position:relative;\"><a href=\"#developer-first-navigation\" aria-label=\"developer first navigation 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>Developer-First Navigation</h3>\n<p><img src=\"/a8c155c2b6faf3d5f4b4de4e2b14d763/developers-menu.webp\" alt=\"This image shows the LoginRadius menu bar, highlighting the developer dropdown.\">   </p>\n<p>We’ve been analyzing developer workflows to identify how you access key resources. That’s why we redesigned our navigation with one goal in mind: to reduce clicks and make essential resources readily available.</p>\n<p>The new LoginRadius structure puts APIs, SDKs, and integration guides right at the menu bar under the Developers dropdown so you can get started faster. Our Products, Solutions, and Customer Services are also clearly categorized, helping development teams quickly find the right tools and make informed decisions.</p>\n<h3 id=\"quick-understanding-of-integration-benefits\" style=\"position:relative;\"><a href=\"#quick-understanding-of-integration-benefits\" aria-label=\"quick understanding of integration benefits 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>Quick Understanding of Integration Benefits</h3>\n<p><img src=\"/b2f9a964a2da0ea83e2f8596b833bba7/we-support-your-tech-stack.webp\" alt=\"This image shows a list of popular programming languages and frameworks offered by LoginRadius.\"></p>\n<p>Developers now have a clear view of the tech stack available with LoginRadius, designed to support diverse business needs.</p>\n<p>Our platform offers pre-built SDKs for Node.js, Python, Java, and more, making CIAM integration seamless across popular programming languages and frameworks.</p>\n<h2 id=\"over-to-you-now\" style=\"position:relative;\"><a href=\"#over-to-you-now\" aria-label=\"over to you now 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>Over to You Now!</h2>\n<p>Check out our <a href=\"https://www.loginradius.com/\">revamped LoginRadius website</a> and see how the improved experience makes it easier to build, scale, and secure your applications.</p>\n<p>Do not forget to explore the improved navigation and API documentation, and get started with our free trial today. We’re excited to see what you’ll build with LoginRadius!</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":"February 21, 2025","updated_date":null,"description":"LoginRadius’ vision is to give developers a product that simplifies identity management so they can focus on building, deploying, and scaling their applications. To enhance this experience, we’ve redesigned our website interface, making navigation more intuitive and reassuring that essential resources are easily accessible.","title":"Revamped & Ready: Introducing the New Developer-First LoginRadius Website","tags":["Developer tools","API","Identity Management","User Authentication"],"pinned":true,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7857142857142858,"src":"/static/80b4e4fbe176a10a327d273504607f32/58556/hero-section.webp","srcSet":"/static/80b4e4fbe176a10a327d273504607f32/61e93/hero-section.webp 200w,\n/static/80b4e4fbe176a10a327d273504607f32/1f5c5/hero-section.webp 400w,\n/static/80b4e4fbe176a10a327d273504607f32/58556/hero-section.webp 800w,\n/static/80b4e4fbe176a10a327d273504607f32/99238/hero-section.webp 1200w,\n/static/80b4e4fbe176a10a327d273504607f32/7c22d/hero-section.webp 1600w,\n/static/80b4e4fbe176a10a327d273504607f32/1258b/hero-section.webp 2732w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Rakesh Soni","github":"oyesoni","avatar":"rakesh-soni.jpg"}}}},"pageContext":{"limit":6,"skip":222,"currentPage":38,"type":"///","numPages":161,"pinned":"ee8a4479-3471-53b1-bf62-d0d8dc3faaeb"}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}