<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-403-that-redesigned-our-auth-three-login-systems-one-rust-middleware-qzxvrcfdm" -->

---
title: The 403 That Redesigned Our Auth: Three Login Systems,...
description: A retrospective on how a multi-tenant MICE SaaS platform accumulated three separate authentication systems organically, and how a 403 error triggered by a...
canonical: https://daily.dev/posts/the-403-that-redesigned-our-auth-three-login-systems-one-rust-middleware-qzxvrcfdm
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The 403 That Redesigned Our Auth: Three Login Systems, One Rust Middleware | daily.dev
og:description: A retrospective on how a multi-tenant MICE SaaS platform accumulated three separate authentication systems organically, and how a 403 error triggered by a...
og:url: https://daily.dev/posts/the-403-that-redesigned-our-auth-three-login-systems-one-rust-middleware-qzxvrcfdm
og:image: https://api.daily.dev/og/posts/QzxvrcFdM.png
og:image:alt: The 403 That Redesigned Our Auth: Three Login Systems, One Rust Middleware
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The 403 That Redesigned Our Auth: Three Login Systems, One Rust Middleware

**[Medium](https://daily.dev/sources/medium_js)** · 13 min read · 0 upvotes · 0 comments

## Summary

A retrospective on how a multi-tenant MICE SaaS platform accumulated three separate authentication systems organically, and how a 403 error triggered by a cross-event token mismatch led to unifying all three under a single Rust middleware. The post explains the domain reasons each auth system existed (Supabase Auth for platform staff, custom bcrypt JWT for exhibitors scoped to event+year, a third for business matchmaking), why merging the user tables wasn't the right fix, and how a fallback chain middleware handles all three token dialects. Honest trade-offs are covered: three secrets means three of everything to rotate, the service-role swap for addon identities removes database-enforced tenancy as a safety net, 24-hour stateless JWTs are too long for the trust model, and the legacy default cookie lingered. The key insight: cryptographic authenticity is easy; token relevance (is this the right credential for this context?) needs a single owner.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://ray-k.medium.com/the-403-that-redesigned-our-auth-three-login-systems-one-rust-middleware-2ba39ae935ee>

---

Tags: [#authentication](https://daily.dev/tags/authentication), [#rust](https://daily.dev/tags/rust), [#jwt](https://daily.dev/tags/jwt), [#multi-tenancy](https://daily.dev/tags/multi-tenancy)

[View this post on daily.dev](https://daily.dev/posts/the-403-that-redesigned-our-auth-three-login-systems-one-rust-middleware-qzxvrcfdm)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The 403 That Redesigned Our Auth: Three Login Systems, One Rust Middleware","url":"https://daily.dev/posts/the-403-that-redesigned-our-auth-three-login-systems-one-rust-middleware-qzxvrcfdm","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-403-that-redesigned-our-auth-three-login-systems-one-rust-middleware-qzxvrcfdm"},"datePublished":"2026-07-25T19:30:05.624Z","dateModified":"2026-07-25T19:30:47.316Z","description":"A retrospective on how a multi-tenant MICE SaaS platform accumulated three separate authentication systems organically, and how a 403 error triggered by a...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b76159d8c6929cc6f9edb114eb256f61?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b76159d8c6929cc6f9edb114eb256f61?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-403-that-redesigned-our-auth-three-login-systems-one-rust-middleware-qzxvrcfdm","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"authentication,rust,jwt,multi-tenancy","timeRequired":"PT13M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"The 403 That Redesigned Our Auth: Three Login Systems, One Rust Middleware"}]}
```

