<?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: bruda345</title>
    <description>The latest articles on DEV Community by bruda345 (@brudda345).</description>
    <link>https://dev.to/brudda345</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%2F687149%2Fac4d698b-a21e-4a7a-a187-bb300c386612.jpeg</url>
      <title>DEV Community: bruda345</title>
      <link>https://dev.to/brudda345</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/brudda345"/>
    <language>en</language>
    <item>
      <title>Understanding OAuth2.0 and OpenID Connect: A Simple Guide with Implementation</title>
      <dc:creator>bruda345</dc:creator>
      <pubDate>Thu, 24 Jul 2025 18:23:23 +0000</pubDate>
      <link>https://dev.to/brudda345/understanding-oauth20-and-openid-connect-a-simple-guide-with-implementation-56n0</link>
      <guid>https://dev.to/brudda345/understanding-oauth20-and-openid-connect-a-simple-guide-with-implementation-56n0</guid>
      <description>&lt;h2&gt;
  
  
  Identity and resource ?
&lt;/h2&gt;

&lt;p&gt;Identity and access management (IAM) deals with making sure who can access what. Only the people with proper access with a limited set of permissions can access or alter a user’s data. There are two aspects to this from an application user point of view, authentication and authorisation, which we will cover in a bit. Any user related data or URI that is requested can be termed as resource here (ex. contacts stored in google account, cloud storage data, etc).&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%2Fauant9q14n0jvqq29ql4.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%2Fauant9q14n0jvqq29ql4.png" alt="claims" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Identity provider vs resource provider?
&lt;/h2&gt;

&lt;p&gt;Usually, authentication servers, are often hosted at a different domain than the resource servers. This is done for the purposes of security, separation of concerns makes it less likely to have a single point of failure or corruption.&lt;/p&gt;

&lt;p&gt;The authentication servers are the identity providers (ex. accounts.google.com), which verify user’s identity to the system (user roles and associated permissions are sent back which helps with access management) and validates the resources he has access to.&lt;/p&gt;

&lt;p&gt;The resource servers is where the actual resources or URIs are hosted. These can be anything that the user is requesting (ex. contacts.google.com).&lt;/p&gt;

&lt;h2&gt;
  
  
  Identity provider: internal vs external ?
&lt;/h2&gt;

&lt;p&gt;Storing a users username and password once he signs up on a website in-house in a database, performing his authentication authorisation when he logs into the system, performing session management would mean maintaining his identity internally.&lt;/p&gt;

&lt;p&gt;Offloading this task to trusted third-party website, such as Okta would make for an external identity provider. This can be done for ex. via use of aws cognito service which helps with the integration with external identity provider.&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%2Ftqsvoqtdpoedrrrov8mr.webp" 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%2Ftqsvoqtdpoedrrrov8mr.webp" alt="oauth2 flow" width="800" height="374"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  OAuth2.0 Intuition (users perspective)
&lt;/h2&gt;

&lt;p&gt;Let's assume a user already has an account on Google. He has some contacts stored and some entries in his google calendar. This data that is stored on Googles servers, all of these resources are owned by the user(Resource owner) on the Resource server. Every time he wants to access this data, he has to verify to Google that he is the true owner which he does with now a days sometimes a  two factors of authentication ( 1. username- password, 2. OTP).&lt;/p&gt;

&lt;p&gt;Suppose this user logs into a third-party application and wants to provide his contact details to this application. The third-party application can request for a resource that is stored on the resource servers of Google if this users allow for his consent. This authorisation and access/roles/permission providing will take place at the Authorisation server.&lt;/p&gt;

&lt;p&gt;User initiates Auth request at Third party app (client).&lt;/p&gt;

&lt;p&gt;Client makes request to Auth Server, which provides grant upon validation of consent.&lt;/p&gt;

&lt;p&gt;Client exchanges the grant for an access token from Auth server.&lt;/p&gt;

&lt;p&gt;Client uses the access token to access resources at resource server.&lt;/p&gt;

&lt;p&gt;This is the whole idea behind OAuth2.0.&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%2Fuqhek6dk0o4spmjwn90u.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%2Fuqhek6dk0o4spmjwn90u.png" alt="abstract protocol flow" width="561" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  OAuth2.0 (authorisation protocol)
&lt;/h2&gt;

&lt;p&gt;The scenario described above is an authorisation request from a third-party application (GET request with a redirect URI embedded in it) to the authorisation server of Google (accounts.google.com), which prompts a consent screen to the user which will use the redirect URI to go back to the third-party website upon providing consent (the redirect XHR request has an auth code/grant which the third party website exchanges with google for an access token through a back channel.&lt;/p&gt;

&lt;p&gt;This request the third-party makes to the authorisation server (accounts.google.com) of Google for the resource specific (contacts/username-xyz-contacts) permissions and access is made be possible with exchange of the auth code/grant for the access token. Once the third-party website has the access token, it can make a request to the resource server (contacts.google.com)  with this token and get the data.&lt;/p&gt;

&lt;p&gt;This whole process is about securely exchange of tokens between a third-party website and Google’s authorisation server to provide it access to a resource upon user consent is OAuth2.0 in a nutshell.&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%2Fzi36vhjps3vxhxjgar9w.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%2Fzi36vhjps3vxhxjgar9w.png" alt="oauth 2.0 and openId connect in detial" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Open ID connect and single sign on (SSO)
&lt;/h2&gt;

&lt;p&gt;Authentication protocol built on top of OAuth2.0. Basically validating a users identity using an external provider where user already has his creds stored(Google).&lt;/p&gt;

&lt;p&gt;In the whole process above for OAuth2.0, along with access token, if the ID tokens are requested, the process helps in authenticating the user, and thats what OpenID connect does, it provides the “ identity layer” with the help of “ID token” Which provides authentication on top of Oauth 2.0.&lt;/p&gt;

&lt;p&gt;There is also another token called as “refresh token” which is used to obtain new access token upon time expiry without requiring re-authentication.&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%2F384wxk368hsr2400inad.webp" 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%2F384wxk368hsr2400inad.webp" alt="tokens" width="638" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All these tokens are JWT tokens (&lt;a href="https://jwt.io/" rel="noopener noreferrer"&gt;https://jwt.io/&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;p&gt;An implementation of SSO login can be done in Node.js with the help of a third party library called PassportJS which offer Strategies to link different Identity providers with your application. I have used google strategy and for that I had to set up api credentials on google cloud. API credentials will give you a client id and client secret which will help google identify your application when it makes an SSO request and while setting up this you will have to provide a callback URL which is a route in your application to which google will redirect upon providing of consent. I have attached a video link at the end which will help you with the api credential setup. Using standard implementation guidelines through passportJS, you can set up strategies in your application with a callback function that will bring the profile data upon validation, there are success and failure callback routes which can be set up for proper redirection (refer to the code in the project link below or PassportJS docs for configuration).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import passport from 'passport';
import dotenv from 'dotenv'
import { Strategy as GoogleStrategy } from 'passport-google-oauth20';
dotenv.config();

const GOOGLE_CLIENT_ID = process.env.GOOGLE_CLIENT_ID;
const GOOGLE_CLIENT_SECRET = process.env.GOOGLE_CLIENT_SECRET;
const SERVER_CALLBACK_URI = process.env.SERVER_CALLBACK_URI;

passport.use(new GoogleStrategy({
    clientID: GOOGLE_CLIENT_ID,
    clientSecret: GOOGLE_CLIENT_SECRET,
    callbackURL: SERVER_CALLBACK_URI
},
    function (request, accessToken, refreshToken, profile, done) {
        return done(null, profile);
    })
);

passport.serializeUser(function (user, done) {
    done(null, user);
});

passport.deserializeUser(function (user, done) {
    done(null, user);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code, I have set up the important info that any strategy would need to make a SSO request successful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;clientID&lt;/li&gt;
&lt;li&gt;clientSecret&lt;/li&gt;
&lt;li&gt;callbackURL&lt;/li&gt;
&lt;li&gt;callback function&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Going over this image should sum things up if you have made it this far:&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%2Feocdqtofwq5tpbii5uea.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%2Feocdqtofwq5tpbii5uea.png" alt="auth token exchange flow" width="364" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you wanna take a deeper dive into OAuth2.0, check out these references:&lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;p&gt;OktaDev official channel OAuth2.0 video for fundamental understanding: &lt;a href="https://www.youtube.com/watch?v=996OiexHze0&amp;amp;t=958s" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=996OiexHze0&amp;amp;t=958s&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Google documentation for developers realted to Identity and OAuth: &lt;a href="https://developers.google.com/identity/protocols/oauth2" rel="noopener noreferrer"&gt;https://developers.google.com/identity/protocols/oauth2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Google API creds setup video by AppWrite: &lt;a href="https://www.youtube.com/watch?v=tgO_ADSvY1I" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=tgO_ADSvY1I&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An in-progress project i'm making using PassportJs for learning purposes: &lt;a href="https://github.com/YashS96/auth-system" rel="noopener noreferrer"&gt;https://github.com/YashS96/auth-system&lt;/a&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%2F6829z64d1odzva4vwhfh.webp" 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%2F6829z64d1odzva4vwhfh.webp" alt="thanks" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>architecture</category>
      <category>security</category>
    </item>
    <item>
      <title>Benefits and pitfalls of Vibe coding: navigating the AI-assisted era</title>
      <dc:creator>bruda345</dc:creator>
      <pubDate>Thu, 24 Jul 2025 17:57:07 +0000</pubDate>
      <link>https://dev.to/brudda345/benefits-and-pitfalls-of-vibe-coding-navigating-the-ai-assisted-era-246j</link>
      <guid>https://dev.to/brudda345/benefits-and-pitfalls-of-vibe-coding-navigating-the-ai-assisted-era-246j</guid>
      <description>&lt;p&gt;&lt;em&gt;A candid reflection on how AI coding assistants are reshaping the development landscape—and what we might be losing in the process.&lt;/em&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%2Ft8eiybqkltipxob777rj.webp" 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%2Ft8eiybqkltipxob777rj.webp" alt="mackbook image" width="720" height="576"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Over the course of the last year, I've become deeply embedded in the AI-assisted coding ecosystem. I use Perplexity, Claude, Chat GPT, Cursor, GitHub Copilot all on a daily basis, in fact I just wrote a synopsis of this article and gave it to Claude for refinement, but then I had to rewrite and refine it myself, much like my experience with coding with these helpers and ended up doubling my work. So here’s a short account of my experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Evolution of My Coding Practice 💻 🧑‍💻
&lt;/h2&gt;

&lt;p&gt;Initially, I approached AI assistants as tools for specific pain points. I'd offload those cumbersome code snippets that would otherwise consume disproportionate amounts of my time. But the more I used these tools, the less effort I wanted to put myself in implementing the tasks directly by myself manually at a low level. My effort started going into thinking how to structure the code better, review what the Agent had written to make it optimised and so high level thinking of the whole repo, whether things are consistent, in proper folders etc started becoming more of what I did. It is making me more efficient at low level design. &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%2F667fqnj1584d17blzl45.webp" 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%2F667fqnj1584d17blzl45.webp" alt="Cursor AI image" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Along with that whatever i build has a component of high level design and how it ties with the system’s architecture, so using these agents frees up my mind to think about how things fit on that level and helps me avoid major pitfalls and design more scalable and better solutions.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "Fail Fast" Advantage 🚀 ⏩ 🚀
&lt;/h2&gt;

&lt;p&gt;Perhaps nowhere is this more evident than in project bootstrapping. Setting up a new repository with a hexagonal architecture pattern, implementing MVC structures, or establishing consistent folder hierarchies—tasks that once required hours of setup and reference checking—now happen in minutes. The AI handles the scaffolding while I focus on the design decisions that truly matter.&lt;/p&gt;

&lt;p&gt;This acceleration enables a "fail fast" model of development. I can rapidly prototype ideas, test architectural decisions, and iterate on concepts without getting trapped in implementation details. The barrier between idea and working prototype has dramatically lowered. &lt;/p&gt;

&lt;h2&gt;
  
  
  Skills that matter now ‼️ 🚨 🔔
&lt;/h2&gt;

&lt;p&gt;Counterintuitively, working with AI assistants has forced me to think like a more senior developer by default. The more functional and technical clarity you possess about what needs to be accomplished, the better you can leverage these tools. Vague instructions yield mediocre code; precise specifications produce excellent results. &lt;br&gt;
This dynamic reinforces a crucial truth: even in our AI-saturated era, first-principle problem solving, clarity of vision, and deep technical knowledge remain paramount.&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%2Fhzbwvsjz459ccvg4po2v.jpg" 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%2Fhzbwvsjz459ccvg4po2v.jpg" alt="Always has been meme" width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These have always been the distinguishing skills of exceptional developers. Everything else—programming languages, frameworks, even coding itself—has always been tooling. AI assistants are simply the latest, most sophisticated tools in our arsenal.  &lt;/p&gt;

&lt;h2&gt;
  
  
  The &lt;strong&gt;NOT&lt;/strong&gt; so hidden costs 🙈
&lt;/h2&gt;

&lt;p&gt;But this efficiency comes with genuine trade-offs that deserve honest examination.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The most immediate cost is the substantial increase in code review overhead. AI-generated code requires careful scrutiny, often multiple rounds of refinement, and frequent course corrections. What should be a straightforward implementation becomes a collaborative editing session where you're constantly providing feedback and direction.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There's a frustrating irony in AI-assisted coding: sometimes the overhead of explaining what you want, perhaps most concerning is how AI assistance can diminish the intrinsic satisfaction of building. When the creative process becomes delegated, some of that joy inevitably dissipates.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When you haven't written every line yourself, you lack the intimate familiarity that comes from building something from the ground up. This knowledge gap manifests most painfully during debugging sessions, where unfamiliarity with AI-generated code can significantly extend troubleshooting time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The most subtle but potentially most significant cost is the gradual erosion of low-level coding skills and problem-solving intuition. If you consistently outsource implementation details, those neural pathways begin to weaken.   &lt;br&gt;
The Bottom Line&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Has my productivity increased? Absolutely. But at what cost? degradation of my low-level coding skills?  Peace of mind? NO! The cost is straight forward, roughly ~$40 per month (~$20 for Claude, ~$20 for Cursor).😆 &lt;/p&gt;

&lt;h2&gt;
  
  
  Looking Forward ⏭️
&lt;/h2&gt;

&lt;p&gt;The AI-assisted coding revolution isn't going anywhere. The question isn't whether to embrace these tools, but how to do so thoughtfully. The key is maintaining balance—leveraging AI for what it does well (boilerplate, scaffolding, optimisation) while preserving the human skills that remain irreplaceable (architectural thinking, creative problem-solving, and yes, the ability to debug and optimise code you understand completely).&lt;br&gt;
The best developers of the AI era won't be those who can quickly prompt an AI assistant to build stuff, nor those who steadfastly refuse to use them. But those who are essentially good developers with strong technical knowledge.&lt;/p&gt;

&lt;p&gt;Ciao!&lt;/p&gt;

</description>
      <category>vibecoding</category>
      <category>ai</category>
      <category>programming</category>
      <category>openai</category>
    </item>
  </channel>
</rss>
