<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nisarga B D on Medium]]></title>
        <description><![CDATA[Stories by Nisarga B D on Medium]]></description>
        <link>https://medium.com/@nisargabhandigadi?source=rss-a6a8c341f90d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*buPVXgf9DJLfqLQodxwwZg.jpeg</url>
            <title>Stories by Nisarga B D on Medium</title>
            <link>https://medium.com/@nisargabhandigadi?source=rss-a6a8c341f90d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 21:05:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nisargabhandigadi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[One Login, Two Worlds: How Keycloak and Ory Think About Identity]]></title>
            <link>https://medium.com/@nisargabhandigadi/one-login-two-worlds-how-keycloak-and-ory-think-about-identity-78c132c2f383?source=rss-a6a8c341f90d------2</link>
            <guid isPermaLink="false">https://medium.com/p/78c132c2f383</guid>
            <category><![CDATA[iam-policy]]></category>
            <dc:creator><![CDATA[Nisarga B D]]></dc:creator>
            <pubDate>Sat, 10 Jan 2026 12:22:06 GMT</pubDate>
            <atom:updated>2026-01-18T03:07:00.673Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*ohLjrlBp-elvcHEkd5Etgg.png" /></figure><h3>Introduction</h3><p>A developer stands at a crossroads.</p><p>On one side is a familiar world — a single system that handles login, tokens, roles, and permissions.<br> On the other is a quieter, more explicit world — one where identity is broken into carefully defined responsibilities.</p><p>Both solve identity.<br>Both protect applications.<br>But they do so with <strong>very different mental models</strong>.</p><p>This article isn’t about which tool is better.<br> It’s about how <strong>Keycloak and Ory think about identity</strong>, and why that difference matters as systems grow.</p><h3>First, Let’s Ground Ourselves: What Is IAM Really?</h3><p>Before choosing paths, Alice (and we) need clarity on one thing:</p><p><strong>Identity and Access Management (IAM)</strong> is not one problem.</p><p>It is <strong>four different problems</strong>, often confused as one.</p><ol><li><strong>Who are you?</strong> → Authentication</li><li><strong>Are you logged in?</strong> → Session management</li><li><strong>What can you access?</strong> → Authorization</li><li><strong>Should this API request pass?</strong> → Enforcement</li></ol><p>Most systems hide these differences. Ory does not.</p><h4>Two Worlds, Two Philosophies</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yiq67CV09biM71jotEdLlw.png" /></figure><h4>Keycloak: Identity as a Single System</h4><p>Alice opens an application and enters the Keycloak world — a single kingdom where identity is handled inside one castle.</p><p>Keycloak authenticates Alice, creates her session, issues tokens, and embeds her roles or permissions directly into those tokens. When Alice returns to the application, the app trusts the token and makes authorization decisions based on its claims.</p><p>For many teams, this feels intuitive:</p><ul><li>One deployment</li><li>One admin console</li><li>One place to manage identity</li></ul><p>This model works well when applications are few and access rules are relatively stable.</p><p>As systems grow, the trade-off becomes visible. Authorization logic becomes tightly coupled to tokens and applications, and changing access behavior often requires updating token structure, application logic, or both.</p><h4>Ory: Identity as Explicit Workflows</h4><p>Ory starts from a different assumption.</p><p>Authentication, token issuance, authorization, and enforcement are <strong>not the same problem</strong> — so they should not live in the same system.</p><p>Instead of hiding complexity behind a single service, Ory makes each step explicit.</p><p>This shifts identity from a “black box” into a <strong>composable workflow</strong>.</p><h4>Alice Logs In with Ory</h4><ol><li><strong>Hydra — Token and OAuth Flow : </strong>Hydra never sees Alice’s password — it only coordinates OAuth2 and OpenID Connect flows.<br>Alice starts login. Her request reaches Hydra, which handles OAuth2 and OpenID Connect.<br> Hydra checks whether Alice is already authenticated.</li><li><strong>Kratos — Authentication and Sessions : </strong>Kratos owns user credentials and session cookies, but does not issue OAuth tokens.<br> Seeing Alice is not authenticated, Hydra redirects her to Kratos.<br> Kratos verifies Alice’s credentials, applies login rules (passwords, MFA, recovery), and creates a session.</li><li><strong>Hydra — Token Issuance : </strong>Tokens issued by Hydra are audience-scoped and meant for downstream services, not browsers.<br> Alice is redirected back to Hydra.<br> Now confident that authentication is complete, Hydra issues access, refresh, and ID tokens.</li><li><strong>Oathkeeper + Keto — Enforcement and Authorization : </strong><br> When Alice accesses a protected API, her request passes through Oathkeeper.<br> Oathkeeper validates Alice’s token with Hydra and asks Keto whether Alice is allowed to perform the requested action.<br> Only authorized requests reach the backend.</li></ol><p>Each component does one job — and nothing more.</p><p>In a real system, login and access follow a clear sequence:</p><ol><li>A user initiates login or accesses a protected resource.</li><li>OAuth/OIDC requests reach Hydra, which checks whether the user is already authenticated.</li><li>If not authenticated, the user is redirected to Kratos.</li><li>Kratos verifies credentials, handles login or registration, and creates a session.</li><li>The user is redirected back to Hydra.</li><li>Hydra issues OAuth2 tokens (access, refresh, ID).</li><li>API requests pass through Oathkeeper.</li><li>Oathkeeper validates tokens via Hydra and checks authorization decisions via Keto.</li><li>Requests are allowed or denied <strong>before</strong> reaching the backend.</li></ol><p>At no point does the application need to implement login logic, decode tokens, or evaluate policies.</p><p>Each component has one responsibility — and only one</p><h3>Closing Thoughts</h3><p>Keycloak simplifies identity by <strong>centralizing it</strong>.</p><p>Ory simplifies identity by <strong>making responsibilities explicit</strong>.</p><p>The difference is subtle at the beginning — when applications are few and access rules are simple.<br> It becomes visible when systems scale, policies evolve frequently, and services multiply.</p><p>Ory’s strength is not abstraction, but separation:</p><ul><li>Authentication evolves independently</li><li>Authorization policies change without redeploying apps</li><li>Enforcement stays consistent across services</li><li>Backends remain free of IAM logic</li></ul><p>Centralization feels easier at first.<br> But over time, <strong>clear boundaries become a strength</strong>.</p><p>Ory doesn’t remove identity complexity — <br> it models it honestly</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78c132c2f383" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>