<?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: Sohil Lalakiya</title>
    <description>The latest articles on DEV Community by Sohil Lalakiya (@sohillalakiya).</description>
    <link>https://dev.to/sohillalakiya</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%2F659123%2F2a6cb1b9-9c75-4270-8ed7-d0c809b78957.png</url>
      <title>DEV Community: Sohil Lalakiya</title>
      <link>https://dev.to/sohillalakiya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sohillalakiya"/>
    <language>en</language>
    <item>
      <title>Front-Channel vs Back-Channel Logout in OpenID Connect (OIDC)</title>
      <dc:creator>Sohil Lalakiya</dc:creator>
      <pubDate>Thu, 26 Mar 2026 18:57:34 +0000</pubDate>
      <link>https://dev.to/sohillalakiya/front-channel-vs-back-channel-logout-in-openid-connect-oidc-2o5e</link>
      <guid>https://dev.to/sohillalakiya/front-channel-vs-back-channel-logout-in-openid-connect-oidc-2o5e</guid>
      <description>&lt;p&gt;In modern authentication systems built on OpenID Connect (OIDC), we implement Single Sign-On (SSO) correctly, but we do not focus enough on the logout part. However, managing sessions across relying parties is just as important as the login itself.&lt;/p&gt;

&lt;p&gt;Logout is not just about ending a session in one application — it is about complete session termination across all relying parties (RPs).&lt;/p&gt;

&lt;p&gt;OIDC provides two standardized logout implementation mechanisms:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Front-Channel Logout (OpenID Connect Front-Channel Logout 1.0)&lt;/li&gt;
&lt;li&gt;Back-Channel Logout (OpenID Connect Back-Channel Logout 1.0)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Both are official specifications designed to solve the single logout problem, and understanding the differences between them is critical for building a secure SSO system.&lt;/p&gt;




&lt;h3&gt;
  
  
  (1) Front-Channel Logout
&lt;/h3&gt;

&lt;p&gt;Front-Channel Logout is defined in the OpenID Connect Front-Channel Logout 1.0 specification. It is a browser-based logout mechanism.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it works:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User or RP initiates logout&lt;/li&gt;
&lt;li&gt;RP redirects the user to the IdP’s end_session_endpoint with an ID token&lt;/li&gt;
&lt;li&gt;IdP validates the ID token and clears its session&lt;/li&gt;
&lt;li&gt;IdP loads the registered logout URLs of all RPs using the browser (typically via hidden iframes)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key characteristics:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses the user agent (browser) as the communication medium&lt;/li&gt;
&lt;li&gt;Relies on HTTP redirects/iframes&lt;/li&gt;
&lt;li&gt;Requires a registered front-channel logout URL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy to implement&lt;/li&gt;
&lt;li&gt;No backend-to-backend communication needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Logout is not guaranteed because iframes can fail or be blocked&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  (2) Back-Channel Logout
&lt;/h3&gt;

&lt;p&gt;Back-Channel Logout is a server-to-server logout mechanism.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it works:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User or RP initiates logout&lt;/li&gt;
&lt;li&gt;IdP validates the user's session&lt;/li&gt;
&lt;li&gt;IdP generates a signed logout token (JWT) and sends it to each RP&lt;/li&gt;
&lt;li&gt;RP validates the token and terminates the user session&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7g9ogvwxexcwz49fv3vz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7g9ogvwxexcwz49fv3vz.png" alt=" " width="784" height="882"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key characteristics:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses HTTP POST (server-to-server communication)&lt;/li&gt;
&lt;li&gt;Requires a back-channel logout URI&lt;/li&gt;
&lt;li&gt;The logout token is a JWT and contains the following claims:&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;iss (Issuer)&lt;/li&gt;
&lt;li&gt;sub (Subject / User)&lt;/li&gt;
&lt;li&gt;aud (Client ID)&lt;/li&gt;
&lt;li&gt;sid (Session)&lt;/li&gt;
&lt;li&gt;events (contains logout event claim)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Not affected by browser restrictions and works even if the browser is closed&lt;/li&gt;
&lt;li&gt;Logout delivery is guaranteed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Slightly complex to implement&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  When should you use each?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Use Front-Channel Logout when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have a simple application ecosystem&lt;/li&gt;
&lt;li&gt;Quick implementation is needed&lt;/li&gt;
&lt;li&gt;Security is not critical&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Back-Channel Logout when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You are building an enterprise-grade system&lt;/li&gt;
&lt;li&gt;Security is critical&lt;/li&gt;
&lt;li&gt;You need guaranteed logout&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>authentication</category>
      <category>oidc</category>
      <category>auth</category>
    </item>
    <item>
      <title>PKCE Explained: Securing the OAuth 2.0 Authorization Code Flow</title>
      <dc:creator>Sohil Lalakiya</dc:creator>
      <pubDate>Sun, 08 Mar 2026 15:17:03 +0000</pubDate>
      <link>https://dev.to/sohillalakiya/pkce-explained-securing-the-oauth-20-authorization-code-flow-2i1o</link>
      <guid>https://dev.to/sohillalakiya/pkce-explained-securing-the-oauth-20-authorization-code-flow-2i1o</guid>
      <description>&lt;h1&gt;
  
  
  Proof Key for Code Exchange (PKCE)
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;PKCE&lt;/strong&gt; stands for &lt;strong&gt;Proof Key for Code Exchange&lt;/strong&gt;. It is a security extension for the OAuth 2.0 Authorization Code Flow that protects the authorization code from interception attacks. As the name suggests, PKCE is used to secure the authorization code exchange during the OAuth authentication flow.&lt;/p&gt;

&lt;p&gt;PKCE is primarily designed for &lt;strong&gt;public clients&lt;/strong&gt; such as mobile applications and single-page applications (SPAs), which cannot securely store a client secret.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why is it needed?
&lt;/h2&gt;

&lt;p&gt;In the traditional OAuth 2.0 Authorization Code Flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The application requests an authorization code.&lt;/li&gt;
&lt;li&gt;The authorization server returns the authorization code.&lt;/li&gt;
&lt;li&gt;The application exchanges the authorization code for tokens using its client credentials (&lt;code&gt;client_id&lt;/code&gt; and optionally &lt;code&gt;client_secret&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The Problem
&lt;/h3&gt;

&lt;p&gt;In the above flow, the problem is that public clients do not have a client secret. An attacker may intercept the authorization code from the redirect URI (for example through a malicious application or browser interception) and use it to obtain tokens.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PKCE prevents this attack&lt;/strong&gt; by binding the authorization request to the token exchange request using a one-time cryptographic secret.&lt;/p&gt;




&lt;h2&gt;
  
  
  How PKCE works
&lt;/h2&gt;

&lt;p&gt;The following diagram illustrates the &lt;strong&gt;OAuth 2.0 Authorization Code Flow with PKCE&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fds0rw8xwafdl2msu9z68.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fds0rw8xwafdl2msu9z68.png" alt="PKCE Mermaid Diagram" width="800" height="710"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Client application generates &lt;code&gt;code_verifier&lt;/code&gt; and &lt;code&gt;code_challenge&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;code_verifier&lt;/strong&gt;: A secure random string known only to the client application.&lt;br&gt;
&lt;strong&gt;code_challenge&lt;/strong&gt;: Derived from the &lt;code&gt;code_verifier&lt;/code&gt;. It can either be the plain value of &lt;code&gt;code_verifier&lt;/code&gt;, or the SHA256 hash of the &lt;code&gt;code_verifier&lt;/code&gt; encoded using Base64URL (recommended method &lt;strong&gt;S256&lt;/strong&gt;).&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;code_challenge&lt;/code&gt; is sent to the authorization server in the initial authorization request. The authorization server stores the &lt;code&gt;code_challenge&lt;/code&gt; and later verifies it during the token exchange.&lt;/p&gt;


&lt;h2&gt;
  
  
  Let's understand this with an example
&lt;/h2&gt;

&lt;p&gt;Imagine a scenario where:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your application URL: https://myapp.com
Your authorization server URL: https://authserver.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Endpoints
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Authorization Endpoint: https://authserver.com/authorize
Token Endpoint: https://authserver.com/token
Redirect URI: https://myapp.com/callback
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 1: The application generates the code_verifier and code_challenge
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;code_verifier dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
code_challenge BASE64URL_ENCODE(SHA256(code_verifier))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example code_challenge:&lt;/strong&gt; &lt;code&gt;E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 2: Construct the authorization URL
&lt;/h3&gt;

&lt;p&gt;Construct the URL with &lt;code&gt;code_challenge&lt;/code&gt;, &lt;code&gt;code_challenge_method&lt;/code&gt;, and other required parameters (state, nonce, client_id, etc.) and redirect the user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Example: https://authserver.com/authorize?client_id=myclient&amp;amp;response_type=code&amp;amp;redirect_uri=https://myapp.com/callback&amp;amp;scope=openidprofile&amp;amp;state=xyz&amp;amp;nonce=abc&amp;amp;code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&amp;amp;code_challenge_method=S256
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Server Storage and Redirect
&lt;/h3&gt;

&lt;p&gt;The authorization server stores the &lt;code&gt;code_challenge&lt;/code&gt; and redirects the user to the application callback URL with a temporary authorization code.&lt;/p&gt;

&lt;p&gt;This code is used to exchange tokens, but to exchange it, the client must provide the &lt;code&gt;code_verifier&lt;/code&gt;. Therefore, even if an attacker steals the authorization code from the URL, they cannot exchange it for tokens without the correct &lt;code&gt;code_verifier&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Token Request
&lt;/h3&gt;

&lt;p&gt;The client application sends a token request with the authorization code and the original &lt;code&gt;code_verifier&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Verification
&lt;/h3&gt;

&lt;p&gt;The authorization server matches the &lt;code&gt;code_verifier&lt;/code&gt; with the stored &lt;code&gt;code_challenge&lt;/code&gt;:&lt;br&gt;
&lt;code&gt;BASE64URL(SHA256(code_verifier)) == stored code_challenge&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If they match, the authorization server issues the tokens. Otherwise, the request is rejected.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;PKCE is a powerful extension to the OAuth 2.0 Authorization Code Flow that significantly enhances security, especially for public clients such as mobile applications and single-page applications (SPAs).&lt;/p&gt;

&lt;p&gt;In modern application development, &lt;strong&gt;PKCE is considered a best practice for all OAuth clients&lt;/strong&gt;, including confidential clients, because it adds an extra layer of protection against authorization code interception attacks.&lt;/p&gt;

</description>
      <category>authjs</category>
      <category>pkce</category>
      <category>security</category>
      <category>programming</category>
    </item>
    <item>
      <title>Making Authentication Seamless: How SSO Works in Modern Systems</title>
      <dc:creator>Sohil Lalakiya</dc:creator>
      <pubDate>Thu, 02 Oct 2025 15:31:22 +0000</pubDate>
      <link>https://dev.to/sohillalakiya/making-authentication-seamless-how-sso-works-in-modern-systems-121n</link>
      <guid>https://dev.to/sohillalakiya/making-authentication-seamless-how-sso-works-in-modern-systems-121n</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;In today's digital world, we use many applications in our day-to-day life, and remembering different usernames and passwords for each one is painful.&lt;/p&gt;

&lt;p&gt;This is where &lt;strong&gt;Single Sign-On (SSO)&lt;/strong&gt; comes into the picture.&lt;/p&gt;

&lt;p&gt;SSO allows users to enter their credentials only once and then access multiple applications without having to re-enter credentials.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Single Sign-On (SSO)?
&lt;/h2&gt;

&lt;p&gt;Single Sign-On is an authentication process that allows users to access multiple applications without being asked for credentials repeatedly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; If you log in to Google once, you automatically get access to YouTube, Gmail, Google Drive, and other apps without logging in to each one separately.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Do We Need SSO?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;User Experience:&lt;/strong&gt; One login grants access to multiple systems&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stronger Security:&lt;/strong&gt; Centralized authentication allows stronger controls&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduced IT Burden:&lt;/strong&gt; Easier user management from a central Identity Provider&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compliance &amp;amp; Monitoring:&lt;/strong&gt; Centralized login activity helps with audits&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Key Players in SSO
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;User&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The person who accesses applications&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Service Provider (SP)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The application the user wants to access (e.g., YouTube, Gmail, Google Drive)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Identity Provider (IdP)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The trusted authentication system that verifies the user's identity (e.g., Google Identity, Keycloak)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Authentication Protocol&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The rules that define how the SP and IdP communicate (e.g., SAML, OAuth2, OIDC)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  How Does SSO Work? (Step by Step)
&lt;/h2&gt;

&lt;p&gt;Let's imagine you want to log in to Google Drive using SSO.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. User tries to access Google Drive
&lt;/h3&gt;

&lt;p&gt;Google Drive does not authenticate you directly.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Redirect to Identity Provider (IdP)
&lt;/h3&gt;

&lt;p&gt;The IdP is now responsible for checking your credentials.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Authentication at the IdP
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The IdP checks its session&lt;/li&gt;
&lt;li&gt;If you are not already authenticated, it will ask for your email and password&lt;/li&gt;
&lt;li&gt;Once authenticated, the IdP confirms your identity&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Issue Token
&lt;/h3&gt;

&lt;p&gt;The IdP generates a token for the user and sends it back.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Token Verification
&lt;/h3&gt;

&lt;p&gt;The Service Provider verifies the token. If valid, you get access to the application.&lt;/p&gt;




&lt;h2&gt;
  
  
  Technical View: Full Token Exchange Flow
&lt;/h2&gt;

&lt;p&gt;Since SSO can use different protocols (SAML, OAuth2, OIDC), the most modern and common is &lt;strong&gt;OIDC&lt;/strong&gt;, which is built on top of OAuth2.&lt;/p&gt;

&lt;p&gt;This guide explains the &lt;strong&gt;Authorization Code Flow with PKCE&lt;/strong&gt;, which is the standard for web and mobile apps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: User Accesses Application (Service Provider)
&lt;/h3&gt;

&lt;p&gt;The user visits: &lt;code&gt;https://myapp.com&lt;/code&gt; and clicks &lt;strong&gt;Login with SSO&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Redirect to Identity Provider
&lt;/h3&gt;

&lt;p&gt;The Service Provider redirects the user to the IdP with parameters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;client_id&lt;/code&gt; → unique ID of the app registered in IdP&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;redirect_uri&lt;/code&gt; → where IdP should send the response&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;scope&lt;/code&gt; → requested information (profile, email, openid)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;response_type=code&lt;/code&gt; → authorization code flow&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;state&lt;/code&gt; → CSRF protection token&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;code_challenge&lt;/code&gt; → PKCE for security&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 3: Authentication at the IdP
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The browser shows the IdP login screen&lt;/li&gt;
&lt;li&gt;The user enters username, password, maybe MFA&lt;/li&gt;
&lt;li&gt;The IdP validates credentials → user authenticated&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 4: Authorization Code Issued
&lt;/h3&gt;

&lt;p&gt;After successful login, the IdP does not issue a token directly.&lt;/p&gt;

&lt;p&gt;Instead, it generates an &lt;strong&gt;Authorization Code&lt;/strong&gt; and sends the user back:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://myapp.com/callback?code=AUTH_CODE&amp;amp;state=xyz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, the Service Provider makes a secure POST request to the IdP's Token Endpoint with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;client_id&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;redirect_uri&lt;/code&gt; (must match original)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;grant_type=authorization_code&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;code=AUTH_CODE&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;code_verifier&lt;/code&gt; (PKCE check)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The IdP verifies the code and PKCE challenge. If valid → issues tokens.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Tokens Issued
&lt;/h3&gt;

&lt;p&gt;The IdP responds with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"access_token"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"eyJhbGciOiJIUzI1NiIsInR..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"id_token"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"eyJhbGciOiJSUzI1NiIsInR..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"refresh_token"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0d1f...xyz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"token_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Bearer"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"expires_in"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3600&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Service Provider then validates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Signature&lt;/strong&gt; (using IdP's public key)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expiry&lt;/strong&gt; (&lt;code&gt;exp&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audience&lt;/strong&gt; (&lt;code&gt;aud&lt;/code&gt;) matches the app&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Issuer&lt;/strong&gt; (&lt;code&gt;iss&lt;/code&gt;) matches the IdP&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If valid → the Service Provider creates a session.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔑 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;So, this is how SSO works — simple and seamless for the user, but under the hood it's powered by cryptography, tokens, and strict validation.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>security</category>
      <category>ai</category>
      <category>software</category>
    </item>
    <item>
      <title>🔐 Breaking Down Identity, Authentication, Authorization &amp; SSO</title>
      <dc:creator>Sohil Lalakiya</dc:creator>
      <pubDate>Wed, 17 Sep 2025 18:12:41 +0000</pubDate>
      <link>https://dev.to/sohillalakiya/breaking-down-identity-authentication-authorization-sso-hf0</link>
      <guid>https://dev.to/sohillalakiya/breaking-down-identity-authentication-authorization-sso-hf0</guid>
      <description>&lt;p&gt;In this article you will get to know about the identity system and I will help you understand the basic fundamental concepts of the identity system.&lt;/p&gt;

&lt;p&gt;At the end of this article you will get the answers to the following questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is identity?&lt;/li&gt;
&lt;li&gt;What is authentication and authorization?&lt;/li&gt;
&lt;li&gt;What is access control?&lt;/li&gt;
&lt;li&gt;What are tokens?&lt;/li&gt;
&lt;li&gt;What is SSO?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now first let's start by understanding what identity is.&lt;/p&gt;

&lt;h2&gt;
  
  
  🆔 What is Identity?
&lt;/h2&gt;

&lt;p&gt;Identity refers to the unique representation of a person or system within the digital ecosystem.&lt;/p&gt;

&lt;p&gt;For example: In real life your identity includes your name, fingerprint, photo ID, and in the digital world your identity includes your username, email, and user ID.&lt;/p&gt;

&lt;p&gt;Identity also includes some attributes which are known as &lt;strong&gt;identity attributes&lt;/strong&gt; or &lt;strong&gt;claims&lt;/strong&gt;. This is extra information about the user, for example: name, role, department, etc.&lt;/p&gt;

&lt;p&gt;Now let's talk about authentication and authorization.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔐 What is Authentication?
&lt;/h2&gt;

&lt;p&gt;Authentication is a type of process for verifying who the user is.&lt;/p&gt;

&lt;p&gt;For example: you enter your email and password, and before entering the system, the system will first compare the password with your email to verify if it is really you or not.&lt;/p&gt;

&lt;p&gt;In the modern world, system authentication also includes OTP, biometrics, social login, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛡️ What is Authorization?
&lt;/h2&gt;

&lt;p&gt;Authorization is the process of verifying what a user is allowed to do after the user is authenticated.&lt;/p&gt;

&lt;p&gt;For example: after login, the system will check whether you are allowed to access and change user data or if you can just read the user data.&lt;/p&gt;

&lt;p&gt;If you want to understand in simple terms:&lt;br&gt;
Authentication is like a passport at the airport, and authorization will decide whether you sit in business class or economy.&lt;/p&gt;

&lt;h2&gt;
  
  
  🏢 What is Identity Provider (IdP)?
&lt;/h2&gt;

&lt;p&gt;An identity provider is a service that manages user identities and handles authentication.&lt;/p&gt;

&lt;p&gt;IdP stores user credentials and uses them for authentication. After authentication, it issues tokens for service provider applications.&lt;/p&gt;

&lt;p&gt;Examples of IdPs: Google, Okta, Keycloak, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 What is Access Control?
&lt;/h2&gt;

&lt;p&gt;Access control means controlling what users are allowed to do within the system.&lt;/p&gt;

&lt;p&gt;There are many types of access control available, but here we have two main types:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;RBAC&lt;/strong&gt; - Role Based Access Control&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ABAC&lt;/strong&gt; - Attribute Based Access Control&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;RBAC:&lt;/strong&gt; In role-based access control, permissions are based on the user's role.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;admin role → can delete user&lt;/li&gt;
&lt;li&gt;editor role → can edit and read user&lt;/li&gt;
&lt;li&gt;viewer role → can only view user&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;ABAC:&lt;/strong&gt; In attribute-based access control, permissions are based on the user's attributes, resources, and environment.&lt;/p&gt;

&lt;p&gt;For example: Allow user if user's department is HR and resource type is employee data and action is view.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎫 What are Tokens?
&lt;/h2&gt;

&lt;p&gt;Tokens are digital objects that are used for authentication and authorization. Usually tokens are JWT-based (JSON Web Token).&lt;/p&gt;

&lt;p&gt;There are mainly 3 types of tokens:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Access Tokens&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Refresh Tokens&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID Tokens&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Access Token:&lt;/strong&gt; It is used to access protected APIs or resources. It is valid for a short time and contains permissions (roles) and user ID.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Refresh Token:&lt;/strong&gt; This is a long-lived token and it is used for getting new access tokens when needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ID Token:&lt;/strong&gt; It contains claims about the authenticated user.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚪 What is SSO?
&lt;/h2&gt;

&lt;p&gt;SSO stands for Single Sign-On. It is an authentication method that allows users to log in once and access multiple applications without re-login.&lt;/p&gt;

&lt;p&gt;For example: you log in to your Google account and now you can access YouTube, Gmail, and Google Drive.&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚙️ How Does SSO Work?
&lt;/h2&gt;

&lt;p&gt;Here all apps trust the same identity provider. So when you start an application, first it redirects the user to the IdP, but the IdP will declare the user to be verified and authenticated. Then the app will issue the token and let the user in.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 Conclusion
&lt;/h2&gt;

&lt;p&gt;Understanding identity and access control is fundamental for building secure digital systems. These concepts—identity, authentication, authorization, access control, tokens, and SSO—work together to ensure the right users have the right access to the right resources at the right time. Mastering these basics will help you design better, more secure applications.&lt;/p&gt;

</description>
      <category>security</category>
      <category>programming</category>
      <category>identity</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Why react deprecated react-react-app ?</title>
      <dc:creator>Sohil Lalakiya</dc:creator>
      <pubDate>Mon, 07 Apr 2025 04:15:00 +0000</pubDate>
      <link>https://dev.to/sohillalakiya/why-react-deprecated-react-react-app--le6</link>
      <guid>https://dev.to/sohillalakiya/why-react-deprecated-react-react-app--le6</guid>
      <description>&lt;h1&gt;
  
  
  🚨 Sunset of Create-React-App: A New Era for React Developers Begins
&lt;/h1&gt;

&lt;p&gt;It's an emotional moment for all React developers and the entire React community — &lt;strong&gt;React has officially deprecated &lt;code&gt;create-react-app&lt;/code&gt; (CRA)&lt;/strong&gt; for new applications.&lt;/p&gt;

&lt;p&gt;If you try to use &lt;code&gt;create-react-app&lt;/code&gt; for your new projects now, you'll likely encounter an error.&lt;/p&gt;

&lt;p&gt;According to the official &lt;a href="https://react.dev/learn/start-a-new-react-project" rel="noopener noreferrer"&gt;React documentation&lt;/a&gt; and GitHub repositories, &lt;code&gt;create-react-app&lt;/code&gt; is &lt;strong&gt;no longer recommended&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  ❓ Why Did React Deprecate Create-React-App?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;create-react-app&lt;/code&gt; (CRA) played a &lt;strong&gt;major role in the React ecosystem&lt;/strong&gt; for many years. With a single command, developers could scaffold a fully working project with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hot Module Replacement (HMR)&lt;/li&gt;
&lt;li&gt;Local development server&lt;/li&gt;
&lt;li&gt;Babel and Webpack pre-configured&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, as the needs of modern web applications grew, CRA started to &lt;strong&gt;fall short in key areas&lt;/strong&gt; like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🚀 Server-side rendering (SSR)&lt;/li&gt;
&lt;li&gt;🔐 Authentication&lt;/li&gt;
&lt;li&gt;📦 Code splitting&lt;/li&gt;
&lt;li&gt;🌐 Routing&lt;/li&gt;
&lt;li&gt;🔄 Data fetching&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To achieve these features, developers often had to rely on &lt;strong&gt;third-party libraries&lt;/strong&gt;, making CRA less relevant for production-ready applications.&lt;/p&gt;

&lt;p&gt;So, to keep pace with the modern requirements, &lt;strong&gt;React has moved on from CRA&lt;/strong&gt; and is encouraging developers to adopt &lt;strong&gt;frameworks or build tools&lt;/strong&gt; that are better suited for complex apps.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔄 What's Next?
&lt;/h2&gt;

&lt;p&gt;React now recommends two paths for new projects or for migrating existing ones:&lt;/p&gt;




&lt;h3&gt;
  
  
  🧭 Option 1: Migrate to a Framework
&lt;/h3&gt;

&lt;p&gt;React recommends using full-featured frameworks that support SSR and Single Page Applications (SPA) out of the box.&lt;/p&gt;

&lt;p&gt;Here are the top suggestions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Next.js&lt;/strong&gt; – The most popular React framework with built-in SSR, routing, image optimization, and more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React Router Framework&lt;/strong&gt; – Focused on routing, now expanding to support more features.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expo (for React Native)&lt;/strong&gt; – A powerful toolset for building cross-platform mobile apps using React.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  🛠️ Option 2: Migrate to a Build Tool
&lt;/h3&gt;

&lt;p&gt;If you want more control and prefer custom setups, React recommends these modern build tools:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Vite&lt;/strong&gt; – Lightning-fast development server with support for hot module replacement and fast builds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Parcel&lt;/strong&gt; – Zero-config bundler with out-of-the-box support for many features.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rsbuild&lt;/strong&gt; – A newer bundler optimized for performance and customization.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🚚 How to Migrate Your Existing CRA App?
&lt;/h2&gt;

&lt;p&gt;You can migrate by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choosing a framework like &lt;strong&gt;Next.js&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Or setting up your app manually with &lt;strong&gt;Vite&lt;/strong&gt;, &lt;strong&gt;Parcel&lt;/strong&gt;, or &lt;strong&gt;Rsbuild&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Gradually moving over features like routing, state management, and build scripts&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🎉 Conclusion
&lt;/h2&gt;

&lt;p&gt;The deprecation of &lt;code&gt;create-react-app&lt;/code&gt; marks the end of an era, but also the &lt;strong&gt;beginning of a more modern, flexible, and powerful React ecosystem&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;React continues to evolve, and it's exciting to see where it's heading. Embrace the change, try out new tools, and build even better apps!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Happy Learning! 🚀&lt;/strong&gt;&lt;/p&gt;




</description>
      <category>webdev</category>
      <category>react</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Just Deployed My Text Encryption Decryption Tool</title>
      <dc:creator>Sohil Lalakiya</dc:creator>
      <pubDate>Thu, 03 Apr 2025 01:26:00 +0000</pubDate>
      <link>https://dev.to/sohillalakiya/just-deployed-my-text-encryption-decryption-tool-1h3e</link>
      <guid>https://dev.to/sohillalakiya/just-deployed-my-text-encryption-decryption-tool-1h3e</guid>
      <description>&lt;p&gt;"Encryption tools are already available on the internet, but for simplicity and my own use, I built one myself!" 🔐&lt;/p&gt;

&lt;p&gt;I have multiple accounts across different platforms, and each account has a unique password. Remembering all of them is tough! 😵💫&lt;/p&gt;

&lt;p&gt;Earlier, I used a Google Sheet to store my passwords, but I realized that if I ever lost access to it, my passwords could be exposed. That’s when I thought—why not store them in an encrypted format instead of plain text?&lt;/p&gt;

&lt;p&gt;To solve this problem, I built a Text Encryption &amp;amp; Decryption Tool using React.js and Crypto-JS. Now, I can securely encrypt my passwords before storing them anywhere! 🚀&lt;/p&gt;

&lt;p&gt;🔹 Key Features:&lt;br&gt;
✅ Supports multiple encryption algorithms &lt;/p&gt;

&lt;p&gt;✅ Secure key-based encryption &amp;amp; decryption &lt;/p&gt;

&lt;p&gt;✅ Easy-to-use interface with copy-to-clipboard functionality &lt;/p&gt;

&lt;p&gt;✅ No server-side data storage—everything runs locally&lt;/p&gt;

&lt;p&gt;🔧 Tech Stack: React.js, Crypto-JS, Parcel&lt;/p&gt;

&lt;p&gt;💡 This project helped me dive deeper into cryptography and front-end security. If you also struggle with managing passwords securely.&lt;/p&gt;

&lt;p&gt;give it a try: 🔗 Live Demo: &lt;a href="https://encrypt-my-password.netlify.app" rel="noopener noreferrer"&gt;https://encrypt-my-password.netlify.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Github: &lt;a href="https://github.com/sohillalakiya/password_security" rel="noopener noreferrer"&gt;https://github.com/sohillalakiya/password_security&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Would love to hear your thoughts! Have you ever built something just to simplify your own life? 😃&lt;/p&gt;

&lt;h1&gt;
  
  
  ReactJS #CryptoJS #WebSecurity #Encryption #Coding #WebDevelopment 🚀
&lt;/h1&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
      <category>react</category>
    </item>
    <item>
      <title>React micro-frontend architecture for your next project</title>
      <dc:creator>Sohil Lalakiya</dc:creator>
      <pubDate>Fri, 28 Mar 2025 03:29:53 +0000</pubDate>
      <link>https://dev.to/sohillalakiya/react-micro-frontend-architecture-for-your-next-project-10d6</link>
      <guid>https://dev.to/sohillalakiya/react-micro-frontend-architecture-for-your-next-project-10d6</guid>
      <description>&lt;h1&gt;
  
  
  React Micro Frontend Architecture
&lt;/h1&gt;

&lt;p&gt;Welcome to the &lt;strong&gt;React Micro Frontend Architecture&lt;/strong&gt; project! &lt;/p&gt;

&lt;h2&gt;
  
  
  What is Micro Frontend?
&lt;/h2&gt;

&lt;p&gt;Micro Frontend is an architectural style where a single frontend application is split into smaller, independently deployable micro-applications. This allows teams to work on different parts of a project separately while ensuring modularity and scalability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use Micro Frontend?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; Independent deployment of frontend apps
&lt;/li&gt;
&lt;li&gt; Improved scalability &amp;amp; maintainability
&lt;/li&gt;
&lt;li&gt; Better team collaboration&lt;/li&gt;
&lt;li&gt; Technology agnostic (each micro-app can use different tech stacks)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Source Code
&lt;/h2&gt;

&lt;p&gt;The full source code is available on my &lt;a href="https://github.com/sohillalakiya/react-micro-frontend.git" rel="noopener noreferrer"&gt;Github Repo&lt;/a&gt;. Feel free to explore and customize it!&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Structure
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; react-microfrontend-project
 ├──  host-app (Main container app)
 ├──  micro-app-1 (First micro-frontend)
 ├──  micro-app-2 (Second micro-frontend)
 ├──  README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to Run This Project
&lt;/h2&gt;

&lt;p&gt;Follow these steps to get the project up and running:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Clone the Repository
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; git clone https://github.com/your-username/react-microfrontend.git
 &lt;span class="nb"&gt;cd &lt;/span&gt;react-microfrontend-project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Install Dependencies
&lt;/h3&gt;

&lt;p&gt;For each app (host-app, micro-app-1, micro-app-2), run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;host-app  &lt;span class="c"&gt;# or micro-app-1, micro-app-2&lt;/span&gt;
 npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Start the Applications
&lt;/h3&gt;

&lt;p&gt;Run the following commands in separate terminals:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;host-app &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm start
 &lt;span class="nb"&gt;cd &lt;/span&gt;micro-app-1 &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm start
 &lt;span class="nb"&gt;cd &lt;/span&gt;micro-app-2 &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each application will start on a different port (e.g., &lt;code&gt;localhost:3000&lt;/code&gt;, &lt;code&gt;localhost:3001&lt;/code&gt;, &lt;code&gt;localhost:3002&lt;/code&gt;) and for more refer Readme.md file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Sharing Between Apps
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;host-app&lt;/strong&gt; acts as the main container and loads both micro-apps dynamically.&lt;/li&gt;
&lt;li&gt;Micro-apps can communicate with each other using &lt;strong&gt;props, events, or a global state management system&lt;/strong&gt; (like Redux or Zustand).&lt;/li&gt;
&lt;li&gt;Example: Micro-app-1 sends data to Micro-app-2 via the host-app.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
      <category>react</category>
    </item>
    <item>
      <title>Understanding The Difference Between Caret(^) and Tilde(~) In Your React or Node Project</title>
      <dc:creator>Sohil Lalakiya</dc:creator>
      <pubDate>Tue, 04 Mar 2025 03:35:29 +0000</pubDate>
      <link>https://dev.to/sohillalakiya/understanding-the-difference-between-caret-and-tilde-in-your-react-or-node-project-23ie</link>
      <guid>https://dev.to/sohillalakiya/understanding-the-difference-between-caret-and-tilde-in-your-react-or-node-project-23ie</guid>
      <description>&lt;p&gt;&lt;strong&gt;🎯 Understanding ^ (Caret) and ~ (Tilde) in package.json&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While working with a Node.js or React project, you may have seen ^ (caret) and ~ (tilde) symbols in your package.json file under the dependencies section. These symbols define how the version of dependencies is handled when updating packages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;📌 Let’s understand the version structure first.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;For example, if you specify:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"express": "~4.17.1"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It means dependency follow this version structure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔴 Major version (4): Introduces breaking changes.&lt;/li&gt;
&lt;li&gt;🟠 Minor version (17): Adds new features and solves compatibility issues.&lt;/li&gt;
&lt;li&gt;🟢 Patch version (1): Includes bug fixes and security updates.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;❓ What are the Caret (^) and Tilde (~) symbols ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🚀 Caret sign (^):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The caret symbol will allow you to update the latest minor version without updating the major version.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;For example, if you specify:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"react": "^19.0.2"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now your version can update to any newer version up to 19.X.X but it will not update to 20.0.0 or higher.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ For example valid updates can be: 19.8.7 or 19.9.0 and so on.&lt;/li&gt;
&lt;li&gt;❌ Invalid updates can be : 20.0.1 or 21.0.9 and so on.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;📌 This is the default behavior of packages when you install packages using npm install package_name.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;strong&gt;🎯 Tilde (~):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The tilde symbol will allow you to update the latest patch version without updating the minor version.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;For example, if you specify:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"react": "~19.0.2"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now your version can update to any newer version up to 19.0.X but it will not update to 19.1.0 or higher.&lt;/p&gt;

&lt;p&gt;-✅ For example valid updates can be: 19.0.7 or 19.0.3 and so on.&lt;br&gt;
-❌ Invalid updates can be : 19.1.1 or 19.2.9 and so on.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;🤔 Which one is good for you ?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;✅ Caret (^) :&lt;/strong&gt; use caret if you want to allow minor updates that introduce new features while maintaining backward compatibility.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🛠️ Tilde (~) :&lt;/strong&gt; use tilde if you want to allow just patch updates that introduce security and bug fixes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🔒Locking the exact version&lt;/strong&gt;: you can also go with "react": "19.0.0" (without use of tilde or caret) and it will lock the version updates so in future you can’t get any updates of your package.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Happy Learning 🚀😊!!!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>In React why do we need state variable when we have local variable ?</title>
      <dc:creator>Sohil Lalakiya</dc:creator>
      <pubDate>Sun, 02 Mar 2025 07:07:41 +0000</pubDate>
      <link>https://dev.to/sohillalakiya/in-react-why-do-we-need-state-variable-when-we-have-local-variable--18me</link>
      <guid>https://dev.to/sohillalakiya/in-react-why-do-we-need-state-variable-when-we-have-local-variable--18me</guid>
      <description>&lt;p&gt;So as a React developer, it is important to understand the significance of state variables in React development. React requires state variables as it does not keep track of local variables, so when you attempt to modify them, React does not re-render the DOM.&lt;/p&gt;

&lt;p&gt;In React, state is a JavaScript object that stores data that can be modified over time. When the state of a component changes, React updates the UI to reflect the new state. The setState() method is a built-in method in React that is used to update the state of a component.&lt;/p&gt;

&lt;p&gt;React keeps track of changes made to state variables. When a change is detected, React automatically re-renders the DOM tree using a process called reconciliation. The reconciliation process uses a diff algorithm to determine the most efficient way to make changes to the DOM tree, ensuring that updates to the UI are fast and efficient.&lt;/p&gt;

&lt;p&gt;The primary advantage of using state variables is that they enable the efficient management of complex and dynamic user interfaces. By using state variables to manage the state of a component, the user interface remains responsive and up-to-date with user input.&lt;/p&gt;

&lt;p&gt;Thank You!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Why you should not use INDEX as KEY in React ?</title>
      <dc:creator>Sohil Lalakiya</dc:creator>
      <pubDate>Sun, 02 Mar 2025 07:00:10 +0000</pubDate>
      <link>https://dev.to/sohillalakiya/why-you-should-not-use-index-as-key-in-react--3m0f</link>
      <guid>https://dev.to/sohillalakiya/why-you-should-not-use-index-as-key-in-react--3m0f</guid>
      <description>&lt;p&gt;In React, the key attribute is used by the framework to uniquely identify DOM elements in a list. If a key is not specified, React may have difficulty in efficiently updating the list when new elements are added or existing ones are removed.&lt;/p&gt;

&lt;p&gt;When a new item is added to a list, or an item is removed from the middle, the order of the remaining items may change. If the keys are not properly updated, React may wrongly assume that the DOM element represents the same component as before, even though this is not the case.&lt;/p&gt;

&lt;p&gt;This can result in incorrect rendering or unexpected behaviour, and can even lead to performance issues. Therefore, it is important to use unique keys that can accurately identify each item in the list, especially when dealing with dynamic lists that are subject to frequent updates.&lt;/p&gt;

&lt;p&gt;Thank You!&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
