{"id":60670,"date":"2024-03-18T18:33:24","date_gmt":"2024-03-18T13:03:24","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=60670"},"modified":"2024-03-27T18:42:23","modified_gmt":"2024-03-27T13:12:23","slug":"basic-authentication-using-aws-cognito-for-beginners","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/","title":{"rendered":"Basic Authentication using AWS Cognito for beginners"},"content":{"rendered":"<p>Traditionally, building user authentication from scratch can be time-consuming and complex. This is where Amazon Cognito comes in, offering a hassle-free solution to manage user registration, login, and authorization in your apps.<\/p>\n<p>In this tutorial, we&#8217;ll explore the powerful capabilities of AWS Cognito to create a robust authentication or login system for your applications. Additionally, we&#8217;ll cover the essential steps to route users between pages after successful authentication seamlessly.<\/p>\n<h2><strong>Understanding AWS Cognito<\/strong><\/h2>\n<p>AWS Cognito is a service that simplifies access control for your applications out of the box, saving you the hassle of building a backend and integrating it with a database. Specifically, we&#8217;ll utilize the user pool feature, which acts as a database storing user credentials such as username, email address, and password. AWS Cognito also provides a pre-built UI for login and registration, making the entire process convenient.<\/p>\n<p>Here are the key features of Cognito User Pools:<\/p>\n<ol>\n<li><strong>User Registration:<\/strong><br \/>\n&#8211;\u00a0 Simplified user registration process with customizable sign-up pages.<br \/>\n&#8211;\u00a0 Email verification for enhanced security.<\/li>\n<li><strong>Authentication Methods:<\/strong><br \/>\nSupport for various authentication methods, including:<br \/>\n&#8211;\u00a0 Email and password.<br \/>\n&#8211;\u00a0 Social sign-ins (e.g., Google, Facebook, Amazon).<br \/>\n&#8211;\u00a0 Multi-factor authentication (MFA) for an added layer of security.<\/li>\n<li><strong>Integration and Versatility:<\/strong><br \/>\n&#8211;\u00a0 Seamless integration with web, mobile, and server-side applications.<br \/>\n&#8211;\u00a0 Versatility to support different use cases and application frameworks.<\/li>\n<li><strong>Security Measures:<\/strong><br \/>\n&#8211;\u00a0 Token-based authentication to secure communication between the application and the user pool.<br \/>\n&#8211;\u00a0 Built-in protection against common security threats.<\/li>\n<li><strong>Scalability:<\/strong><br \/>\n&#8211;\u00a0 Automatic scaling to handle a large number of users without manual intervention.<br \/>\n&#8211;\u00a0 Reliable performance even as the user base grows.<\/li>\n<li><strong>Developer-Friendly Tools:<\/strong><br \/>\n&#8211;\u00a0 AWS Cognito provides a hosted UI that developers can leverage for user authentication, reducing the effort required for UI development.<\/li>\n<\/ol>\n<h2>Steps to Create AWS Cognito User Pool<\/h2>\n<p><strong>1. Log in to the AWS Management Console and search for &#8220;Cognito&#8221; using the search bar.<\/strong> Then, open the Cognito service.<\/p>\n<p><span style=\"font-weight: 400;\"><strong>2. Click on the &#8220;Create User Pool&#8221; button.<\/strong> You will choose between two ways users can log in.<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Standard login( default)<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Users create an account with an email and password, managed by Cognito.<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u00a0\u00a0Social login<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Users log in with existing accounts from platforms like Facebook or Google.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>3. Since we are implementing the login with email\/username , we will be selecting the sign-in options with Username and Email.<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60716\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/Create-user-pool-User-pools-Amazon-Cognito-us-east-2-14-1.png\" alt=\"Blog image\" width=\"3456\" height=\"1862\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/Create-user-pool-User-pools-Amazon-Cognito-us-east-2-14-1.png 3456w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/Create-user-pool-User-pools-Amazon-Cognito-us-east-2-14-1-300x162.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/Create-user-pool-User-pools-Amazon-Cognito-us-east-2-14-1-1024x552.png 1024w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/Create-user-pool-User-pools-Amazon-Cognito-us-east-2-14-1-768x414.png 768w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/Create-user-pool-User-pools-Amazon-Cognito-us-east-2-14-1-1536x828.png 1536w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/Create-user-pool-User-pools-Amazon-Cognito-us-east-2-14-1-2048x1103.png 2048w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/Create-user-pool-User-pools-Amazon-Cognito-us-east-2-14-1-624x336.png 624w\" sizes=\"auto, (max-width: 3456px) 100vw, 3456px\" \/><\/p>\n<p><strong>4. Configure security requirements<\/strong><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">Configure your desired settings, such as password policies, multi-factor authentication, MFA methods, and User account recovery. For the test app, we will be choosing MFA methods Authenticator apps.\u00a0<\/span><\/li>\n<li>Regarding the User account recovery option, tick the recommended option for self-service account recovery and choose the option Email. You can choose any other options too.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60720\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/ConfigureSecurity1.png\" alt=\"AWS Cognito - Set password policy and MFA\" width=\"3456\" height=\"1862\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/ConfigureSecurity1.png 3456w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSecurity1-300x162.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSecurity1-1024x552.png 1024w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSecurity1-768x414.png 768w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSecurity1-1536x828.png 1536w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSecurity1-2048x1103.png 2048w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSecurity1-624x336.png 624w\" sizes=\"auto, (max-width: 3456px) 100vw, 3456px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60721\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/ConfigureSecurity2-1.png\" alt=\"AWS Cognito - Set User account recovery \" width=\"3456\" height=\"1862\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/ConfigureSecurity2-1.png 3456w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSecurity2-1-300x162.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSecurity2-1-1024x552.png 1024w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSecurity2-1-768x414.png 768w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSecurity2-1-1536x828.png 1536w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSecurity2-1-2048x1103.png 2048w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSecurity2-1-624x336.png 624w\" sizes=\"auto, (max-width: 3456px) 100vw, 3456px\" \/><\/p>\n<p><strong>5. Configure sign-up experience<\/strong><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">\u00a0Customize the sign-up process to suit your requirements by setting required attributes and custom attributes. These attributes will be displayed to the user on the sign-up page and stored in the Cognito user pool.<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60722\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/ConfigureSignUp1.png\" alt=\"Configure sign-up experience \" width=\"3456\" height=\"1862\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/ConfigureSignUp1.png 3456w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSignUp1-300x162.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSignUp1-1024x552.png 1024w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSignUp1-768x414.png 768w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSignUp1-1536x828.png 1536w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSignUp1-2048x1103.png 2048w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureSignUp1-624x336.png 624w\" sizes=\"auto, (max-width: 3456px) 100vw, 3456px\" \/><\/p>\n<p><strong>6. Configure message delivery<\/strong><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">Configure message delivery by selecting the option &#8220;Send email with Cognito,&#8221; which is recommended for the test application. For production, choose the option &#8220;Send email with Amazon SES.&#8221;<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60725\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/ConfigureMessageDelivery.png\" alt=\"Configure Message Delivery \" width=\"3456\" height=\"1862\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/ConfigureMessageDelivery.png 3456w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureMessageDelivery-300x162.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureMessageDelivery-1024x552.png 1024w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureMessageDelivery-768x414.png 768w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureMessageDelivery-1536x828.png 1536w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureMessageDelivery-2048x1103.png 2048w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/ConfigureMessageDelivery-624x336.png 624w\" sizes=\"auto, (max-width: 3456px) 100vw, 3456px\" \/><\/p>\n<p><strong>7. Integrate your app<\/strong><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">User pool name<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Provide a unique name for your User pool.<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Hosted authentication pages<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We are using Cognito-hosted UI on our test application so we need to check the option &#8220;Use the Cognito Hosted UI&#8221;.<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Domain<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Choose the option &#8220;Use a Cognito domain&#8221; and provide the cognito domain, I am using the random domain name test2080. You can choose as you want.<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Initial app client<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Choose the option &#8220;Public client&#8221;\u00a0 for the App type since we are testing this in the browser.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Enter a friendly name for your app client.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Choose the option &#8220;Generate a client secret&#8221; since we will require it to authorize API requests.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Enter the callback URL as<\/span><a href=\"http:\/\/localhost:3000\/logged-in\"> <span style=\"font-weight: 400;\">http:\/\/localhost:3000\/logged-in<\/span><\/a><span style=\"font-weight: 400;\">. After Cognito authenticates the user, it will redirect them to this callback URL<\/span><\/li>\n<li>Click on Advanced app client settings and add the signOut URL \u00a0<a href=\"http:\/\/localhost:3000\/logout\">http:\/\/localhost:3000\/logout<\/a>. The sign-out URL is a redirect page sent by Cognito when your application signs users out. This is needed only if you want Cognito to direct signed-out users to a page other than the callback URL.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60733\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/Integrate-your-app.png\" alt=\"Integrate your app\" width=\"3456\" height=\"5218\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/Integrate-your-app.png 3456w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/Integrate-your-app-199x300.png 199w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/Integrate-your-app-678x1024.png 678w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/Integrate-your-app-768x1160.png 768w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/Integrate-your-app-1017x1536.png 1017w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/Integrate-your-app-1356x2048.png 1356w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/Integrate-your-app-624x942.png 624w\" sizes=\"auto, (max-width: 3456px) 100vw, 3456px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60828\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/signout2.png\" alt=\"add sign out url\" width=\"1339\" height=\"842\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/signout2.png 1339w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/signout2-300x189.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/signout2-1024x644.png 1024w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/signout2-768x483.png 768w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/signout2-624x392.png 624w\" sizes=\"auto, (max-width: 1339px) 100vw, 1339px\" \/><\/p>\n<p><strong>8. Review and Create<\/strong><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">After reviewing your configurations on the final page, you can create your user pool by clicking &#8220;Create pool\u201d to create your user pool.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">After the user pool is successfully created, you will see it listed as shown below.<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60741\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/UserPool-created.png\" alt=\"list of user pools\" width=\"3456\" height=\"1862\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/UserPool-created.png 3456w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/UserPool-created-300x162.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/UserPool-created-1024x552.png 1024w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/UserPool-created-768x414.png 768w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/UserPool-created-1536x828.png 1536w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/UserPool-created-2048x1103.png 2048w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/UserPool-created-624x336.png 624w\" sizes=\"auto, (max-width: 3456px) 100vw, 3456px\" \/><\/p>\n<p>Now click on the User pool name that we have just created. It will redirect us to the User Pool overview page and click on the App integration tab.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60800\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/userPoolOverview1.png\" alt=\"userPool Overview page\" width=\"3456\" height=\"4016\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/userPoolOverview1.png 3456w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/userPoolOverview1-258x300.png 258w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/userPoolOverview1-881x1024.png 881w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/userPoolOverview1-768x892.png 768w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/userPoolOverview1-1322x1536.png 1322w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/userPoolOverview1-1762x2048.png 1762w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/userPoolOverview1-624x725.png 624w\" sizes=\"auto, (max-width: 3456px) 100vw, 3456px\" \/><\/p>\n<p>Scroll to the end and click on the App client name. It will redirect us to the App Client information page.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60801\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/appClientInfo.png\" alt=\"App client information page\" width=\"3456\" height=\"1850\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/appClientInfo.png 3456w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/appClientInfo-300x161.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/appClientInfo-1024x548.png 1024w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/appClientInfo-768x411.png 768w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/appClientInfo-1536x822.png 1536w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/appClientInfo-2048x1096.png 2048w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/appClientInfo-624x334.png 624w\" sizes=\"auto, (max-width: 3456px) 100vw, 3456px\" \/><\/p>\n<p>We will require Client Id and Client secret value to integrate cognito on our test app.<\/p>\n<p><span style=\"font-weight: 400;\">Here&#8217;s the basic structure of our Node.js application:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">views<\/span>\n<ul>\n<li>\u00a0index.ejs<\/li>\n<li>loggedIn.ejs<\/li>\n<li>loggedOut.ejs<\/li>\n<\/ul>\n<\/li>\n<li><span style=\"font-weight: 400;\">.env<\/span><\/li>\n<li>app.js<\/li>\n<li>package.json<\/li>\n<\/ul>\n<p><strong>.env<\/strong><\/p>\n<p>CLIENT_ID=&lt;client_id&gt;<br \/>\nCLIENT_SECRET=&lt;client_secret&gt;<br \/>\nCOGNITO_DOMAIN=&lt;cognito_domain&gt;<\/p>\n<p>app.js<\/p>\n<div>\n<pre>const express = require('express');\r\n\r\nrequire('dotenv').config();\r\n\r\n\r\nconst app = express();\r\n\r\n\r\nconst port = 3000;\r\n\r\nconst clientId = process.env.CLIENT_ID;\r\n\r\nconst clientSecret = process.env.CLIENT_SECRET;\r\n\r\napp.set('view engine', 'ejs');\r\n\r\n\r\n\r\napp.get('\/', (req, res) =&gt; {\r\n\r\nres.render('index');\r\n\r\n});\r\n\r\n\r\n\r\napp.get('\/logged-in', async (req, res) =&gt; {\r\n\r\nres.render('loggedIn');\r\n\r\n});\r\n\r\n\r\n\r\napp.get('\/logout', (req, res) =&gt; {\r\n\r\nres.render('loggedOut');\r\n\r\n});\r\n\r\n\r\n\r\n\r\napp.listen(port, () =&gt; {\r\n\r\nconsole.log(`Server running at http:\/\/localhost:${port}`);\r\n\r\n});\r\n<\/pre>\n<h3><span style=\"font-weight: 400;\">Creating the Views<\/span><\/h3>\n<p><strong>index.ejs<\/strong><\/p>\n<div>\n<pre>&lt;head&gt;\r\n\r\n    &lt;title&gt;Index Page&lt;\/title&gt;\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n  &lt;h1&gt;Welcome to the Index Page!&lt;\/h1&gt;\r\n\r\n  &lt;a href=\"&lt;%= process.env.COGNITO_DOMAIN %&gt;\/login?client_id=&lt;%= process.env.CLIENT_ID %&gt;&amp;response_type=code&amp;scope=email+openid+phone&amp;redirect_uri=http:\/\/localhost:3000\/logged-in\"&gt;Register\/Login&lt;\/a&gt;\r\n\r\n&lt;\/body&gt;\r\n\r\n&lt;\/html&gt;\r\n\r\n<\/pre>\n<p><strong>loggedIn.ejs<\/strong><\/p>\n<div>\n<pre>&lt;html&gt;\r\n\r\n&lt;head&gt;\r\n\r\n&lt;title&gt;LoggedIn User&lt;\/title&gt;\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;p&gt;You have successfully logged in.&lt;\/p&gt;\r\n\r\n&lt;a\r\n\r\n href=\"&lt;%= process.env.COGNITO_DOMAIN %&gt;\/logout?client_id=&lt;%= process.env.CLIENT_ID %&gt;&amp;logout_uri=http:\/\/localhost:3000\/logout\"&gt;Logout&lt;\/a&gt;\r\n\r\n&lt;\/body&gt;\r\n\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>loggedOut.ejs<\/strong><\/p>\n<pre>&lt;html&gt;\r\n\r\n&lt;head&gt;\r\n\r\n&lt;title&gt;Logout Page&lt;\/title&gt;\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Logout&lt;\/h1&gt;\r\n\r\n&lt;p&gt;You have been successfully logged out.&lt;\/p&gt;\r\n\r\n&lt;a href=\"&lt;%= process.env.COGNITO_DOMAIN %&gt;\/login?client_id=&lt;%= process.env.CLIENT_ID %&gt;&amp;response_type=code&amp;scope=email+openid+phone&amp;redirect_uri=http:\/\/localhost:3000\/logged-in\"&gt;Log back in&lt;\/a&gt;\r\n\r\n&lt;\/body&gt;\r\n\r\n&lt;\/html&gt;<\/pre>\n<div>\n<p>Lets&#8217;s run the test app<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60831\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/indexPage.png\" alt=\"index Page\" width=\"629\" height=\"420\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/indexPage.png 629w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/indexPage-300x200.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/indexPage-624x417.png 624w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60832\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/redirection1.png\" alt=\"Blog image\" width=\"1222\" height=\"533\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/redirection1.png 1222w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/redirection1-300x131.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/redirection1-1024x447.png 1024w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/redirection1-768x335.png 768w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/redirection1-624x272.png 624w\" sizes=\"auto, (max-width: 1222px) 100vw, 1222px\" \/><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60833\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/redirection2.png\" alt=\"Blog image\" width=\"465\" height=\"668\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/redirection2.png 465w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/redirection2-209x300.png 209w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60834\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/redirection3.png\" alt=\"Blog image\" width=\"474\" height=\"447\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/redirection3.png 474w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/redirection3-300x283.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/redirection3-24x24.png 24w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60835\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/redirection4.png\" alt=\"Blog image\" width=\"469\" height=\"831\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/redirection4.png 469w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/redirection4-169x300.png 169w\" sizes=\"auto, (max-width: 469px) 100vw, 469px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60836\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/redirection5.png\" alt=\"Blog image\" width=\"869\" height=\"311\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/redirection5.png 869w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/redirection5-300x107.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/redirection5-768x275.png 768w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/redirection5-624x223.png 624w\" sizes=\"auto, (max-width: 869px) 100vw, 869px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60837\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/redirection6.png\" alt=\"Blog image\" width=\"685\" height=\"488\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/redirection6.png 685w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/redirection6-300x214.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/redirection6-624x445.png 624w\" sizes=\"auto, (max-width: 685px) 100vw, 685px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Let&#8217;s verify whether the user we just created exists in the Cognito user pool.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60839\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/UserCreated.png\" alt=\"User list on cognito\" width=\"1684\" height=\"784\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/UserCreated.png 1684w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/UserCreated-300x140.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/UserCreated-1024x477.png 1024w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/UserCreated-768x358.png 768w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/UserCreated-1536x715.png 1536w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2024\/03\/UserCreated-624x291.png 624w\" sizes=\"auto, (max-width: 1684px) 100vw, 1684px\" \/><\/p>\n<p>The user has just signed up for is successfully showing up in the Cognito dashboard.<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Congratulations! We&#8217;ve successfully set up the authentication layer in your Node.js application using Amazon Cognito. Users can now log in securely through the Cognito-hosted UI, and upon successful login, they will be redirected to our specified endpoint. This is just the beginning of securing your application; feel free to explore more advanced features and configurations offered by Amazon Cognito based on your application&#8217;s requirements.<\/span><\/p>\n<p>&nbsp;<\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>Traditionally, building user authentication from scratch can be time-consuming and complex. This is where Amazon Cognito comes in, offering a hassle-free solution to manage user registration, login, and authorization in your apps. In this tutorial, we&#8217;ll explore the powerful capabilities of AWS Cognito to create a robust authentication or login system for your applications. Additionally, [&hellip;]<\/p>\n","protected":false},"author":1739,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":337,"footnotes":""},"categories":[1174,1185],"tags":[248,5694,5704],"class_list":["post-60670","post","type-post","status-publish","format-standard","hentry","category-aws-2","category-node-js-2","tag-aws","tag-aws-cognito","tag-nodejs"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Traditionally, building user authentication from scratch can be time-consuming and complex. This is where Amazon Cognito comes in, offering a hassle-free solution to manage user registration, login, and authorization in your apps. In this tutorial, we&#039;ll explore the powerful capabilities of AWS Cognito to create a robust authentication or login system for your applications. Additionally,\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Manoj Khatri\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Basic Authentication using AWS Cognito for beginners | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"Traditionally, building user authentication from scratch can be time-consuming and complex. This is where Amazon Cognito comes in, offering a hassle-free solution to manage user registration, login, and authorization in your apps. In this tutorial, we&#039;ll explore the powerful capabilities of AWS Cognito to create a robust authentication or login system for your applications. Additionally,\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Basic Authentication using AWS Cognito for beginners | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Traditionally, building user authentication from scratch can be time-consuming and complex. This is where Amazon Cognito comes in, offering a hassle-free solution to manage user registration, login, and authorization in your apps. In this tutorial, we&#039;ll explore the powerful capabilities of AWS Cognito to create a robust authentication or login system for your applications. Additionally,\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/basic-authentication-using-aws-cognito-for-beginners\\\/#article\",\"name\":\"Basic Authentication using AWS Cognito for beginners | TO THE NEW Blog\",\"headline\":\"Basic Authentication using AWS Cognito for beginners\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/manoj-khatri\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/wp-ttn-blog\\\/uploads\\\/2024\\\/03\\\/Create-user-pool-User-pools-Amazon-Cognito-us-east-2-14-1.png\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/basic-authentication-using-aws-cognito-for-beginners\\\/#articleImage\"},\"datePublished\":\"2024-03-18T18:33:24+05:30\",\"dateModified\":\"2024-03-27T18:42:23+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/basic-authentication-using-aws-cognito-for-beginners\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/basic-authentication-using-aws-cognito-for-beginners\\\/#webpage\"},\"articleSection\":\"AWS, Node.js, aws, aws cognito, NodeJS\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/basic-authentication-using-aws-cognito-for-beginners\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/aws-2\\\/#listItem\",\"name\":\"AWS\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/aws-2\\\/#listItem\",\"position\":2,\"name\":\"AWS\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/aws-2\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/basic-authentication-using-aws-cognito-for-beginners\\\/#listItem\",\"name\":\"Basic Authentication using AWS Cognito for beginners\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/basic-authentication-using-aws-cognito-for-beginners\\\/#listItem\",\"position\":3,\"name\":\"Basic Authentication using AWS Cognito for beginners\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/aws-2\\\/#listItem\",\"name\":\"AWS\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/manoj-khatri\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/manoj-khatri\\\/\",\"name\":\"Manoj Khatri\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/basic-authentication-using-aws-cognito-for-beginners\\\/#authorImage\",\"url\":\"https:\\\/\\\/newersworld-sf-static.tothenew.net\\\/prod\\\/profilePicFolder\\\/bc9643bd-681f-4c0c-93c1-9fecc20e37ee_5279-Manoj-Khatri-PROFILEPICTURE.jpeg\",\"width\":96,\"height\":96,\"caption\":\"Manoj Khatri\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/basic-authentication-using-aws-cognito-for-beginners\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/basic-authentication-using-aws-cognito-for-beginners\\\/\",\"name\":\"Basic Authentication using AWS Cognito for beginners | TO THE NEW Blog\",\"description\":\"Traditionally, building user authentication from scratch can be time-consuming and complex. This is where Amazon Cognito comes in, offering a hassle-free solution to manage user registration, login, and authorization in your apps. In this tutorial, we'll explore the powerful capabilities of AWS Cognito to create a robust authentication or login system for your applications. Additionally,\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/basic-authentication-using-aws-cognito-for-beginners\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/manoj-khatri\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/manoj-khatri\\\/#author\"},\"datePublished\":\"2024-03-18T18:33:24+05:30\",\"dateModified\":\"2024-03-27T18:42:23+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Basic Authentication using AWS Cognito for beginners | TO THE NEW Blog","description":"Traditionally, building user authentication from scratch can be time-consuming and complex. This is where Amazon Cognito comes in, offering a hassle-free solution to manage user registration, login, and authorization in your apps. In this tutorial, we'll explore the powerful capabilities of AWS Cognito to create a robust authentication or login system for your applications. Additionally,","canonical_url":"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/#article","name":"Basic Authentication using AWS Cognito for beginners | TO THE NEW Blog","headline":"Basic Authentication using AWS Cognito for beginners","author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/manoj-khatri\/#author"},"publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/Create-user-pool-User-pools-Amazon-Cognito-us-east-2-14-1.png","@id":"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/#articleImage"},"datePublished":"2024-03-18T18:33:24+05:30","dateModified":"2024-03-27T18:42:23+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/#webpage"},"isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/#webpage"},"articleSection":"AWS, Node.js, aws, aws cognito, NodeJS"},{"@type":"BreadcrumbList","@id":"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.tothenew.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/aws-2\/#listItem","name":"AWS"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/aws-2\/#listItem","position":2,"name":"AWS","item":"https:\/\/www.tothenew.com\/blog\/category\/aws-2\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/#listItem","name":"Basic Authentication using AWS Cognito for beginners"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/#listItem","position":3,"name":"Basic Authentication using AWS Cognito for beginners","previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/aws-2\/#listItem","name":"AWS"}}]},{"@type":"Organization","@id":"https:\/\/www.tothenew.com\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/www.tothenew.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.tothenew.com\/blog\/author\/manoj-khatri\/#author","url":"https:\/\/www.tothenew.com\/blog\/author\/manoj-khatri\/","name":"Manoj Khatri","image":{"@type":"ImageObject","@id":"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/#authorImage","url":"https:\/\/newersworld-sf-static.tothenew.net\/prod\/profilePicFolder\/bc9643bd-681f-4c0c-93c1-9fecc20e37ee_5279-Manoj-Khatri-PROFILEPICTURE.jpeg","width":96,"height":96,"caption":"Manoj Khatri"}},{"@type":"WebPage","@id":"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/#webpage","url":"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/","name":"Basic Authentication using AWS Cognito for beginners | TO THE NEW Blog","description":"Traditionally, building user authentication from scratch can be time-consuming and complex. This is where Amazon Cognito comes in, offering a hassle-free solution to manage user registration, login, and authorization in your apps. In this tutorial, we'll explore the powerful capabilities of AWS Cognito to create a robust authentication or login system for your applications. Additionally,","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/#breadcrumblist"},"author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/manoj-khatri\/#author"},"creator":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/manoj-khatri\/#author"},"datePublished":"2024-03-18T18:33:24+05:30","dateModified":"2024-03-27T18:42:23+05:30"},{"@type":"WebSite","@id":"https:\/\/www.tothenew.com\/blog\/#website","url":"https:\/\/www.tothenew.com\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Basic Authentication using AWS Cognito for beginners | TO THE NEW Blog","og:description":"Traditionally, building user authentication from scratch can be time-consuming and complex. This is where Amazon Cognito comes in, offering a hassle-free solution to manage user registration, login, and authorization in your apps. In this tutorial, we'll explore the powerful capabilities of AWS Cognito to create a robust authentication or login system for your applications. Additionally,","og:url":"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/","og:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Basic Authentication using AWS Cognito for beginners | TO THE NEW Blog","twitter:description":"Traditionally, building user authentication from scratch can be time-consuming and complex. This is where Amazon Cognito comes in, offering a hassle-free solution to manage user registration, login, and authorization in your apps. In this tutorial, we'll explore the powerful capabilities of AWS Cognito to create a robust authentication or login system for your applications. Additionally,","twitter:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"60670","title":null,"description":null,"keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"limit_modified_date":false,"created":"2024-03-06 11:37:08","updated":"2024-03-27 13:12:24","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\/category\/aws-2\/\" title=\"AWS\">AWS<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tBasic Authentication using AWS Cognito for beginners\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.tothenew.com\/blog"},{"label":"AWS","link":"https:\/\/www.tothenew.com\/blog\/category\/aws-2\/"},{"label":"Basic Authentication using AWS Cognito for beginners","link":"https:\/\/www.tothenew.com\/blog\/basic-authentication-using-aws-cognito-for-beginners\/"}],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/60670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1739"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=60670"}],"version-history":[{"count":31,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/60670\/revisions"}],"predecessor-version":[{"id":61002,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/60670\/revisions\/61002"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=60670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=60670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=60670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}