<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Akanksha Agrawal</title>
    <description>The latest articles on DEV Community by Akanksha Agrawal (@akankshaagrawal13).</description>
    <link>https://dev.to/akankshaagrawal13</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F578585%2F34fc9753-7ec5-4f42-9973-125c1469128a.jpeg</url>
      <title>DEV Community: Akanksha Agrawal</title>
      <link>https://dev.to/akankshaagrawal13</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akankshaagrawal13"/>
    <language>en</language>
    <item>
      <title>Aws S3 Bucket Deployment</title>
      <dc:creator>Akanksha Agrawal</dc:creator>
      <pubDate>Wed, 10 Jul 2024 13:31:14 +0000</pubDate>
      <link>https://dev.to/akankshaagrawal13/aws-s3-bucket-deployment-34mm</link>
      <guid>https://dev.to/akankshaagrawal13/aws-s3-bucket-deployment-34mm</guid>
      <description>&lt;p&gt;*&lt;em&gt;Steps: *&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create Angular App ----  ng new angular-app-new &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Build Angular app for production----&amp;gt; ng build --prod&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then dist. folder has been created. Inside we have all the &lt;br&gt;
files that we deploy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sign in to the AWS management console &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create s3 bucket&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;S3 service-&amp;gt; create bucket name-&amp;gt; bucket name-angularnew12-app-&amp;gt; uncheck block all public &lt;br&gt;
access.-&amp;gt; other will be default-&amp;gt; hit create button.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Upload Angular build files to an S3 bucket &lt;br&gt;
Click on that particular bucket:&lt;br&gt;
Add files -&amp;gt; dist. folder-&amp;gt; select all -&amp;gt; open-&amp;gt; successfully uploaded.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deploy on AWS S3 service&lt;br&gt;
go to properties-&amp;gt; static website hosting -&amp;gt; enable-&amp;gt; then we have  index document -&amp;gt; &lt;br&gt;
index.html -&amp;gt; save changes &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;or you can add a bucket policy :&lt;br&gt;
{&lt;br&gt;
  "Version": "2022-06-22",&lt;br&gt;
  "Statement": [&lt;br&gt;
    {&lt;br&gt;
      "Effect": "Allow",&lt;br&gt;
      "Principal": "&lt;em&gt;",&lt;br&gt;
      "Action": [&lt;br&gt;
        "s3:GetObject"&lt;br&gt;
      ],&lt;br&gt;
      "Resource": "arn:aws:s3:::angularnew12-app/&lt;/em&gt;"&lt;br&gt;
    }&lt;br&gt;
  ]&lt;br&gt;
 }&lt;br&gt;
 go to objects-&amp;gt; select all files -&amp;gt; actions -&amp;gt; make it public.&lt;/p&gt;

&lt;p&gt;The project is deployed on AWS s3.&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>Authentication and Authorization in Node.js</title>
      <dc:creator>Akanksha Agrawal</dc:creator>
      <pubDate>Sun, 07 Jul 2024 08:43:41 +0000</pubDate>
      <link>https://dev.to/akankshaagrawal13/authentication-and-authorization-in-nodejs-3oe1</link>
      <guid>https://dev.to/akankshaagrawal13/authentication-and-authorization-in-nodejs-3oe1</guid>
      <description>&lt;p&gt;&lt;strong&gt;The authentication process&lt;/strong&gt; confirms a user's identity using credentials by validating who they claim to be. Authentication assures an application's security by&lt;br&gt;
 guaranteeing that only those with valid credentials can access the system. Authentication is the responsibility of an application's backend.&lt;br&gt;
 Three popular authentication methods in Node.js include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Session-based&lt;/li&gt;
&lt;li&gt;Token-based&lt;/li&gt;
&lt;li&gt;Passwordless&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let's explain a little bit about each of these methods and compare them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Session-based&lt;/strong&gt;&lt;br&gt;
 Session-based authentication is the oldest form of authentication technology. Typically, the flow of a session is as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The user uses their credentials to log in.&lt;/li&gt;
&lt;li&gt;The login credentials are verified against the credentials in a database. The database is responsible for storing which resources can be accessed based on the
session ID.&lt;/li&gt;
&lt;li&gt;The server creates a session with a session ID that is a unique encrypted string. The session ID is stored in the database.&lt;/li&gt;
&lt;li&gt;The session ID is also stored in the browser as a cookie.&lt;/li&gt;
&lt;li&gt;When the user logs out or a specified amount of time has passed, the session ID is destroyed on both the browser and the database.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Token-based&lt;/strong&gt;&lt;br&gt;
Token-based security entails two parts: authentication and authorization. Authentication is the process of providing credentials and obtaining a token that proves the user's credentials. &lt;/p&gt;

&lt;p&gt;Authorization refers to the process of using that token so the resource server knows which resources the user should have access to.&lt;/p&gt;

&lt;p&gt;Token-based Authentication&lt;br&gt;
Token-based authentication uses access tokens to validate users. An access token is a small piece of code that contains information about the user, their permissions,&lt;br&gt;
groups, and expirations that get passed from a server to the client. An ID token is an artifact that proves that the user has been authenticated.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;token&lt;/strong&gt; contains &lt;strong&gt;three parts, the header, the payload, and the signature.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;The header contains information about the type of token and the algorithm used to create it.&lt;/p&gt;

&lt;p&gt;The payload contains user attributes, called claims, such as permissions, groups, and expirations. &lt;/p&gt;

&lt;p&gt;The signature verifies the token's integrity, meaning that the token hasn’t changed during transit. A JSON web token, pronounced "jot" but spelled JWT, is an internet standard for creating encrypted payload data in JSON format.&lt;br&gt;
A user's browser makes a call to an authentication server and gets access to a web application. The authentication server then passes back an ID token which is stored&lt;br&gt;
by the client as an encrypted cookie. The ID token is then passed to the app on the web server as proof that the user has been authenticated.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token-based Authorization&lt;/strong&gt;&lt;br&gt;
This flowchart shows the workflow of a token through the authorization process.&lt;br&gt;
The authorization process gets executed when the web application wants to access a resource, for example, an API that is protected from unauthorized access. The&lt;br&gt;
 user authenticates against the Authorization server. The Authorization server creates an access token (note that the ID token and access token are two separate&lt;br&gt;
 objects) and sends the access token back to the client, where the access token is stored. Then when the user makes requests or resources, the token is passed to the resource, also called an API server. &lt;/p&gt;

&lt;p&gt;The token gets passed with every HTTP request. The token contains embedded information about the user's permissions without&lt;br&gt;
the need to access those permissions from the authorization server. Even if the token is stolen, the hacker doesn't have access to the user's credentials because the token is encrypted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Passwordless&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With passwordless authentication, the user does not need login credentials, but rather, they gain access to the system by demonstrating they possess a factor that&lt;br&gt;
proves their identity. Common factors include biometrics such as a fingerprint, a "magic link" sent to their email address, or a one-time passcode sent to a mobile&lt;br&gt;
 device. Password recovery systems now commonly use passwordless authentication.&lt;/p&gt;

&lt;p&gt;Passwordless authentication is achieved using Public Key and Private Key Encryption. &lt;/p&gt;

&lt;p&gt;In this method, when a user registers for the app, the user's device generates a private key/public key pair that utilizes a factor that proves their identity, as noted above.&lt;/p&gt;

&lt;p&gt;The public key is used to encrypt messages, and the private key is used to decrypt them. The private key is stored on the user's device, and the public key is stored&lt;br&gt;
with the application and registered with a registration service.&lt;br&gt;
Anyone may access the public key, but the private key is only known to the client. When the user signs into the application, the application generates a login challenge, such as requesting biometrics, sending a "magic link", or sending a special code via SMS, encrypting it with the public key. &lt;/p&gt;

&lt;p&gt;The private key allows the&lt;br&gt;
message to be decrypted. The app then verifies the sign-in challenge and accepts the response to authorize the user.&lt;/p&gt;

&lt;p&gt;In this reading, you learned that:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Authentication is the process of confirming a user's identity using credentials by validating who they claim to be.&lt;br&gt;
Session-based authentication uses credentials to create a session ID stored in a database and the client's browser. When the user logs out, the session ID is destroyed.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token-based authentication uses access tokens, often JWTs, that get passed between server and client with the data that is passed between the two.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Passwordless authentication uses public/private key pairs to encrypt and decrypt data passed between client and server without the need for a password.&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction to Middleware &amp; Routers</title>
      <dc:creator>Akanksha Agrawal</dc:creator>
      <pubDate>Sun, 07 Jul 2024 08:01:18 +0000</pubDate>
      <link>https://dev.to/akankshaagrawal13/introduction-to-middleware-routers-25pm</link>
      <guid>https://dev.to/akankshaagrawal13/introduction-to-middleware-routers-25pm</guid>
      <description>&lt;p&gt;In this article, we will discuss the terms middleware and routes.&lt;/p&gt;

&lt;p&gt;Middleware is software that sits between applications, databases, or services and allows those different technologies to communicate. It creates seamless interactions for the end user in a distributed system. &lt;/p&gt;

&lt;p&gt;Express is a messaging framework used to handle routes and write middleware. The front end of an application uses Express to facilitate communication between components on the back end without the front-end and back-end services needing to use the same language. The front end communicates with the middleware, not directly with the back end. &lt;/p&gt;

&lt;p&gt;Messaging frameworks like Express commonly contain JSON, REST APIs, and web services. Older messaging frameworks may contain extensible markup language (XML) and simple object access protocols (SOAP) instead of JSON and REST APIs, respectively. The messaging framework provides a standardized way to handle data transfer among different applications.&lt;/p&gt;

&lt;p&gt;A web server is an example of middleware that connects a website to a database. The web server handles the business logic and routes the data from the database based on the request. A route is the part of the code that associates an HTTP request, such as GET, POST, or DELETE, with a URL and the function that gets called that handles that URL. Routing is used in web development to split an application’s user interface based on rules identified by the browser’s URL. &lt;/p&gt;

&lt;p&gt;Router functions are called “middleware” collectively. Middleware is responsible for responding to an HTTP request or calling another function in the middleware chain. Express handles router functions through the Router class, such as Router.get(). As the name suggests, Router.get() handles HTTP GET requests. Other Router functions include Router.post(), Router.put(), Router.delete() in mostly the same way. These methods take two arguments, a URL path and a callback function. &lt;/p&gt;

&lt;p&gt;In addition to routing, middleware is also responsible for providing secure connections among services by encrypting and decrypting data, managing application loads by distributing traffic to different servers, and sorting or filtering data before the data is returned to the client.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>AWS React App Deployment steps:- </title>
      <dc:creator>Akanksha Agrawal</dc:creator>
      <pubDate>Sat, 13 Feb 2021 08:44:55 +0000</pubDate>
      <link>https://dev.to/akankshaagrawal13/aws-react-app-deployment-steps-1fe5</link>
      <guid>https://dev.to/akankshaagrawal13/aws-react-app-deployment-steps-1fe5</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2ohKwiCI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/leioim5aw5b6d9tgp9vz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2ohKwiCI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/leioim5aw5b6d9tgp9vz.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
