<?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: Vivek Kantariya</title>
    <description>The latest articles on DEV Community by Vivek Kantariya (@vivekkantariya).</description>
    <link>https://dev.to/vivekkantariya</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%2F3041710%2F358a3930-8e59-48bb-9708-8cbfb259516a.jpeg</url>
      <title>DEV Community: Vivek Kantariya</title>
      <link>https://dev.to/vivekkantariya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vivekkantariya"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>Vivek Kantariya</dc:creator>
      <pubDate>Mon, 02 Mar 2026 08:42:04 +0000</pubDate>
      <link>https://dev.to/vivekkantariya/new-blog-29ii</link>
      <guid>https://dev.to/vivekkantariya/new-blog-29ii</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/vivekkantariya" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&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%2Fuser%2Fprofile_image%2F3041710%2F358a3930-8e59-48bb-9708-8cbfb259516a.jpeg" alt="vivekkantariya"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/vivekkantariya/how-access-and-refresh-tokens-work-3e5m" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;How Access and Refresh Tokens Work&lt;/h2&gt;
      &lt;h3&gt;Vivek Kantariya ・ Feb 28&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#accesstoken&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#refreshtoken&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#oauth&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#backend&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>accesstoken</category>
      <category>refreshtoken</category>
      <category>oauth</category>
      <category>backend</category>
    </item>
    <item>
      <title>How Access and Refresh Tokens Work</title>
      <dc:creator>Vivek Kantariya</dc:creator>
      <pubDate>Sat, 28 Feb 2026 19:46:40 +0000</pubDate>
      <link>https://dev.to/vivekkantariya/how-access-and-refresh-tokens-work-3e5m</link>
      <guid>https://dev.to/vivekkantariya/how-access-and-refresh-tokens-work-3e5m</guid>
      <description>&lt;p&gt;Ever wondered how apps like Netflix and Facebook keep you logged in for months without ever asking for your password again? I used to just take it for granted - until I actually dug into how it works under the hood. Turns out, two small things are responsible for that seamless experience: access tokens and refresh tokens.&lt;br&gt;
Let's break it down.&lt;/p&gt;

&lt;p&gt;Modern apps don't pass your username and password around with every request. That would be like showing your passport every single time you walk through a door inside a building you've already entered. It's unnecessary, and honestly, a huge security risk.&lt;br&gt;
Instead, protocols like OAuth 2.0 and OpenID Connect (OIDC) use tokens. You prove who you are once, get a token, and that token does the talking for you from that point on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Here's the simple version of what happens when you hit "Login":
&lt;/h2&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%2Favl2oo6xz8thpio1lixk.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%2Favl2oo6xz8thpio1lixk.png" alt="How tokens are issued and used across servers" width="800" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You make a request to the app - say, "Login with Google."&lt;/li&gt;
&lt;li&gt;The app reaches out to an Authorization Server (Google, in this case), which checks your identity and hands back an authorization code. That code is then exchanged for your tokens.&lt;/li&gt;
&lt;li&gt;From that point on, the app uses your access token to fetch your data from the Resource Server - all without you doing anything.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Authorization Server handles who you are. The Resource Server handles what you're allowed to do.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Access Token
&lt;/h2&gt;

&lt;p&gt;Think of the access token as your daily pass. Every time the app needs to fetch your data or perform an action on your behalf, it attaches the access token to the request. The server looks at it, says "yep, this person is allowed," and responds.&lt;br&gt;
But here's the thing - this token is short-lived, usually only valid for few minutes to a few hours.&lt;br&gt;
Why so short? Because it's exposed a lot. It travels with almost every request, which means there are more opportunities for it to be intercepted. If someone does steal it, keeping it short-lived means the damage window is tiny. They can't do much with a token that expires in few minutes.&lt;br&gt;
A long-lived access token would be a nightmare from a security standpoint. The longer it's valid, the more time an attacker has to exploit it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Refresh Token
&lt;/h2&gt;

&lt;p&gt;Now here's where it gets interesting. If the access token expires every 20 minutes, why aren't you constantly being logged out and forced to re-enter your password?&lt;br&gt;
That's the refresh token's job.&lt;br&gt;
The refresh token is long-lived - we're talking days, weeks, sometimes even months. But it doesn't travel with every request like the access token does. It sits quietly in the background and only gets used for one thing: getting a new access token when the old one expires.&lt;br&gt;
When your access token dies, the app uses the refresh token to silently request a fresh one from the Authorization Server - and you don't feel a thing. No interruption, no login screen, nothing.&lt;br&gt;
One important thing though - the refresh token never goes to the Resource Server. It only ever talks to the Authorization Server. This separation is intentional and keeps it much safer than the access token.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Comparison
&lt;/h2&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%2Ftxisxobiu6xowhm8c3rq.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%2Ftxisxobiu6xowhm8c3rq.png" alt="Quick Comparison" width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Not Just Use One Token?
&lt;/h2&gt;

&lt;p&gt;This is the question that stumped me at first too. Why bother with two?&lt;br&gt;
Here's the honest answer: one token doing everything is a security disaster waiting to happen.&lt;br&gt;
If you had a single long-lived token that was sent with every request, stealing it would give an attacker full access for a long time - and there's not much you could do about it quickly.&lt;br&gt;
By splitting it into two:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The access token gets exposed often, so it's kept short-lived - stolen token, small problem.&lt;/li&gt;
&lt;li&gt;The refresh token is exposed rarely, so it can afford to live longer - and it's much easier to revoke on the server side if something feels off.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References &amp;amp; Further Reading
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://openid.net/developers/how-connect-works/" rel="noopener noreferrer"&gt;OpenID Connect Official Documentation&lt;br&gt;
&lt;/a&gt;&lt;a href="https://auth0.com/docs/secure/tokens/refresh-tokens/refresh-token-rotation" rel="noopener noreferrer"&gt;Auth0 — Refresh Token Rotation&lt;br&gt;
&lt;/a&gt;&lt;a href="https://auth0.com/docs/secure/tokens/access-tokens" rel="noopener noreferrer"&gt;Auth0 — Access Tokens&lt;br&gt;
&lt;/a&gt;&lt;a href="https://www.geeksforgeeks.org/javascript/access-token-vs-refresh-token-a-breakdown/" rel="noopener noreferrer"&gt;Access Token vs Refresh Token: A Breakdown, GeeksforGeeks&lt;br&gt;
&lt;/a&gt;&lt;a href="https://www.descope.com/blog/post/access-token-vs-refresh-token" rel="noopener noreferrer"&gt;Access Token vs Refresh Token: A Breakdown&lt;/a&gt;&lt;a href="https://www.youtube.com/watch?v=L2_gIrDxCes&amp;amp;t=643s" rel="noopener noreferrer"&gt;youtube&lt;/a&gt;&lt;/p&gt;

</description>
      <category>accesstoken</category>
      <category>refreshtoken</category>
      <category>oauth</category>
      <category>backend</category>
    </item>
    <item>
      <title>Object-Oriented Programming in Java — The Heart of Modern Development</title>
      <dc:creator>Vivek Kantariya</dc:creator>
      <pubDate>Tue, 22 Apr 2025 16:46:16 +0000</pubDate>
      <link>https://dev.to/vivekkantariya/object-oriented-programming-in-java-the-heart-of-modern-development-21mf</link>
      <guid>https://dev.to/vivekkantariya/object-oriented-programming-in-java-the-heart-of-modern-development-21mf</guid>
      <description>&lt;p&gt;Have you ever wondered how complex applications like Instagram, Minecraft, or banking software are built and maintained so efficiently? Object-Oriented Programming (OOP) plays a crucial role in managing this complexity.&lt;/p&gt;

&lt;p&gt;In this blog, we’ll explore the core concepts of OOP in Java, understand how classes and objects work, and see real-world analogies to solidify your understanding.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Introduction to Object-Oriented Programming (OOP):
&lt;/h2&gt;

&lt;p&gt;Object-Oriented Programming (OOP) is a programming paradigm that organizes software design around objects rather than just functions and logic. Java, one of the most widely used programming languages, is built entirely on OOP principles, making it a powerful tool for creating scalable, modular, and maintainable applications.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Classes and Objects&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;class is a blueprint&lt;/strong&gt; or prototype from which objects are created. It defines the structure (attributes and methods).&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;object is an instance&lt;/strong&gt; of a class, with actual memory allocation.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Car {  
    String color;  // Attribute (state)  
    void drive() { // Method (behavior)  
        System.out.println(“Car is moving!”);  
    }  
}  

public class Main {  
    public static void main(String[] args) {  
        Car myCar = new Car(); // Object creation  
        myCar.color = “Red”;   // Setting state  
        myCar.drive();         // Calling behavior  
    }  
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;State, Identity, and Behavior&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;State → Represented by attributes (e.g., color of a car).&lt;/li&gt;
&lt;li&gt;Behavior → Defined by methods (e.g., drive()).&lt;/li&gt;
&lt;li&gt;Identity → Unique memory address where the object is stored.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Strengths of OOP:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Modularity — OOP helps break down a large program into smaller, manageable pieces (objects). This modularity makes it easier to maintain and scale applications.&lt;/li&gt;
&lt;li&gt;Reusability — Classes can be reused across different projects.&lt;/li&gt;
&lt;li&gt;Encapsulation — Protects data integrity by controlling access.&lt;/li&gt;
&lt;li&gt;Flexibility — Inheritance and polymorphism allow dynamic, scalable designs.&lt;/li&gt;
&lt;li&gt;Maintainability: Code is easier to update and debug when it’s organized around objects that mimic real-world entities.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. The 4 Pillars of OOP:
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;1. Encapsulation:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bundles data (attributes) and methods (functions) into a single unit (class).&lt;/li&gt;
&lt;li&gt;Protects internal state by controlling access (e.g., using private fields with getters/setters).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;2. Inheritance:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allows a class (subclass) to inherit properties and behaviors from another class (superclass).&lt;/li&gt;
&lt;li&gt;Promotes code reuse and hierarchical organization.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;3. Polymorphism:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enables different classes to respond to the same method call in different ways.&lt;/li&gt;
&lt;li&gt;Achieved via method overriding (same method, different implementations).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;4. Abstraction:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hides complex implementation details and exposes only essential features.&lt;/li&gt;
&lt;li&gt;Uses abstract classes and interfaces to define high-level structures.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Real-Life Analogy:
&lt;/h2&gt;

&lt;p&gt;Think of a class as a car blueprint, and an object as an actual car built from that blueprint.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Class (Blueprint) → Defines attributes (color, model) and behaviors (start(), stop()).&lt;/li&gt;
&lt;li&gt;Object (Car) → A real car with specific properties that can perform actions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Extending the Analogy:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inheritance → An ElectricCar class extending Car (inherits properties).&lt;/li&gt;
&lt;li&gt;Polymorphism → Different cars (Sedan, SUV) can have their own drive() implementations&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Java vs. Python vs. C++: OOP Perspective:
&lt;/h2&gt;

&lt;p&gt;Java is considered a pure object-oriented language because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Everything is an object (except primitives).&lt;/li&gt;
&lt;li&gt;Every piece of code must be wrapped in a class.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Python: supports OOP, but it also allows procedural programming, so it is a multi-paradigm language.&lt;/p&gt;

&lt;p&gt;C++: C++ is an object-oriented language but allows procedural programming. It also includes features like pointers, which Java does not support, making Java simpler and more secure.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Conclusion:
&lt;/h2&gt;

&lt;p&gt;Object-Oriented Programming (OOP) in Java is the backbone of robust, scalable, and maintainable software design. By mastering core principles like classes, objects, inheritance, and polymorphism — and by understanding how Java manages memory — you’re not just coding; you’re engineering solutions that stand the test of time.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. References &amp;amp; Resources:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Kunal Kushwaha’s&lt;/strong&gt; OOP Playlist (Highly recommended for visual learners!)&lt;/li&gt;
&lt;li&gt;GeeksforGeeks OOP Guide (Hands-on examples and problem-solving)&lt;/li&gt;
&lt;li&gt;Official Java Documentation (For in-depth technical clarity)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;PS: Stay tuned for upcoming blogs.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>oop</category>
      <category>java</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
