<?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: Auth By Example</title>
    <description>The latest articles on DEV Community by Auth By Example (@authbyexample1).</description>
    <link>https://dev.to/authbyexample1</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4129486%2F81de18e5-31aa-4a61-8180-8828f484068b.png</url>
      <title>DEV Community: Auth By Example</title>
      <link>https://dev.to/authbyexample1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/authbyexample1"/>
    <language>en</language>
    <item>
      <title>Separate who can grant from who can act</title>
      <dc:creator>Auth By Example</dc:creator>
      <pubDate>Fri, 18 Sep 2026 18:29:12 +0000</pubDate>
      <link>https://dev.to/authbyexample1/separate-who-can-grant-from-who-can-act-26e6</link>
      <guid>https://dev.to/authbyexample1/separate-who-can-grant-from-who-can-act-26e6</guid>
      <description>&lt;p&gt;In many apps, anyone with an “admin” role can both use privileged actions and hand those same powers to other people.&lt;/p&gt;

&lt;p&gt;That mixes two different privileges:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Acting with a permission (delete a project, export data, approve a payment)&lt;/li&gt;
&lt;li&gt;Granting that permission to someone else&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the same role covers both, a compromised admin account — or a confused admin — can quietly expand the blast radius. The attacker does not need to find every secret; they mint new admins.&lt;/p&gt;

&lt;p&gt;A cleaner pattern is separation of duties:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep day-to-day privileged actions on an operator / admin role&lt;/li&gt;
&lt;li&gt;Put permission grants, role assignments, and policy edits on a smaller grantor / IAM role&lt;/li&gt;
&lt;li&gt;Require a second factor, approval, or short time box for grant actions&lt;/li&gt;
&lt;li&gt;Audit grant events separately from ordinary use events&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Authorization is not only “can this user do X right now?” It is also “who is allowed to change the answer to that question?”&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Never trust a client-supplied tenant ID</title>
      <dc:creator>Auth By Example</dc:creator>
      <pubDate>Fri, 18 Sep 2026 13:52:30 +0000</pubDate>
      <link>https://dev.to/authbyexample1/never-trust-a-client-supplied-tenant-id-4g1h</link>
      <guid>https://dev.to/authbyexample1/never-trust-a-client-supplied-tenant-id-4g1h</guid>
      <description>&lt;p&gt;A common authorization bug: the API takes &lt;code&gt;tenant_id&lt;/code&gt; from the request body or query string, then loads that tenant’s data if the user is authenticated.&lt;/p&gt;

&lt;p&gt;Authentication only proves who you are. It does not prove which tenant you may act in.&lt;/p&gt;

&lt;p&gt;Better pattern:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Resolve the caller’s allowed tenants from a server-side session, token claim you issued, or membership store.&lt;/li&gt;
&lt;li&gt;Ignore or strictly validate any client-supplied tenant against that set.&lt;/li&gt;
&lt;li&gt;Scope every query with the authorized tenant — never with the raw client value alone.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the client can pick any tenant ID, they can often read or mutate another customer’s data. That is an IDOR wearing a multi-tenant costume.&lt;/p&gt;

&lt;p&gt;Teach the check: “is this principal allowed for this tenant?” — not “does this tenant exist?”&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>authorization</category>
    </item>
    <item>
      <title>Check permissions again after every trust boundary</title>
      <dc:creator>Auth By Example</dc:creator>
      <pubDate>Fri, 18 Sep 2026 06:21:02 +0000</pubDate>
      <link>https://dev.to/authbyexample1/check-permissions-again-after-every-trust-boundary-c3g</link>
      <guid>https://dev.to/authbyexample1/check-permissions-again-after-every-trust-boundary-c3g</guid>
      <description>&lt;p&gt;Authentication proves who someone is. Authorization decides what they can do. Those are different moments, and they do not travel together forever.&lt;/p&gt;

&lt;p&gt;After a user crosses a trust boundary — a new service, a webhook handler, a background job, a different API gateway — re-check the permission for that action on that resource. A JWT that said "admin" at the edge is not a free pass deep inside your system.&lt;/p&gt;

&lt;p&gt;Treat each hop as untrusted until your policy says otherwise. That habit catches broken assumptions when services are reused, messages are replayed, or callers change.&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Default-deny beats allow-everything-then-trim</title>
      <dc:creator>Auth By Example</dc:creator>
      <pubDate>Thu, 17 Sep 2026 14:56:25 +0000</pubDate>
      <link>https://dev.to/authbyexample1/default-deny-beats-allow-everything-then-trim-3igm</link>
      <guid>https://dev.to/authbyexample1/default-deny-beats-allow-everything-then-trim-3igm</guid>
      <description>&lt;p&gt;Most apps start with a wide-open role and carve exceptions later. That creates silent privilege creep.&lt;/p&gt;

&lt;p&gt;Prefer default-deny: every action is blocked until a grant says otherwise. New features stay locked until you deliberately open them. Audits get easier because you can list who was granted what, instead of hunting for forgotten carve-outs.&lt;/p&gt;

&lt;p&gt;If a new endpoint needs access tomorrow, add an explicit permission. Don’t widen an existing role “just for now.”&lt;/p&gt;

</description>
      <category>security</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
