|
| 1 | +> Note: SemiHybrid and PureJwt modes will be available on future releases. For now you can safely use PureOpaque and Hybrid modes. |
| 2 | +
|
| 3 | +# 🔐 Authentication Modes |
| 4 | + |
| 5 | +UltimateAuth supports multiple authentication modes. |
| 6 | + |
| 7 | +Each mode represents a different balance between: |
| 8 | + |
| 9 | +- Security |
| 10 | +- Performance |
| 11 | +- Control |
| 12 | +- Client capabilities |
| 13 | + |
| 14 | +👉 You don’t always choose a single model. |
| 15 | +UltimateAuth can adapt based on context. |
| 16 | + |
| 17 | +<br> |
| 18 | + |
| 19 | +## 🧩 Available Modes |
| 20 | + |
| 21 | +### PureOpaque |
| 22 | +Fully server-controlled session model. |
| 23 | + |
| 24 | +### Hybrid |
| 25 | +Combines session control with token-based access. |
| 26 | + |
| 27 | +### SemiHybrid |
| 28 | +JWT-based with server-side metadata awareness. |
| 29 | + |
| 30 | +### PureJwt |
| 31 | +Fully stateless token-based authentication. |
| 32 | + |
| 33 | +<br> |
| 34 | + |
| 35 | +## ⚖️ Mode Comparison |
| 36 | + |
| 37 | +| Feature | PureOpaque | Hybrid | SemiHybrid | PureJwt | |
| 38 | +|----------------|------------|------------|----------------|--------------| |
| 39 | +| SessionId | Required | Required | Metadata only | None | |
| 40 | +| Access Token | ❌ | ✔ | ✔ | ✔ | |
| 41 | +| Refresh Token | ❌ | ✔ | ✔ | ✔ | |
| 42 | +| Revocation | Immediate | Immediate | Metadata-based | Not immediate| |
| 43 | +| Statefulness | Full | Hybrid | Semi | Stateless | |
| 44 | +| Server Control | Full | High | Medium | Low | |
| 45 | +| Performance* | Medium | Medium | High | Highest | |
| 46 | +| Offline Support| ❌ | Partial | ✔ | ✔ | |
| 47 | + |
| 48 | +> ⚡ **Performance Note** |
| 49 | +> |
| 50 | +> All modes in UltimateAuth are designed for production use and are highly optimized. |
| 51 | +> |
| 52 | +> The differences here are about **trade-offs**, not absolute speed: |
| 53 | +> |
| 54 | +> 👉 Even the most server-controlled mode is performant enough for real-world applications. |
| 55 | +
|
| 56 | +<br> |
| 57 | + |
| 58 | +## 🧠 How to Think About Auth Modes |
| 59 | +It’s important to understand that authentication modes in UltimateAuth are not rigid system-wide choices. |
| 60 | + |
| 61 | +👉 You are not expected to pick a single mode and use it everywhere. |
| 62 | + |
| 63 | +Instead: |
| 64 | + |
| 65 | +- Different clients can use different modes on a single UAuthHub |
| 66 | +- The mode can change **per request** |
| 67 | +- UltimateAuth selects the most appropriate mode based on **Client Profile and runtime context** |
| 68 | + |
| 69 | +<br> |
| 70 | + |
| 71 | +### 🔄 Runtime-Driven Behavior |
| 72 | +In a typical application: |
| 73 | + |
| 74 | +- Blazor Server → PureOpaque |
| 75 | +- Blazor WASM → Hybrid |
| 76 | +- API → PureJwt |
| 77 | + |
| 78 | +👉 All can coexist in the same system. |
| 79 | + |
| 80 | +You don’t split your architecture — UltimateAuth adapts automatically. |
| 81 | + |
| 82 | +### ⚙️ You Can Override Everything |
| 83 | +UltimateAuth provides **safe defaults**, but nothing is locked. |
| 84 | + |
| 85 | +You can: |
| 86 | + |
| 87 | +- Force a specific auth mode |
| 88 | +- Customize behavior per client |
| 89 | +- Replace default strategies |
| 90 | + |
| 91 | +👉 The system is designed to be flexible without sacrificing safety. |
| 92 | + |
| 93 | +### 🛡 Safe by Default |
| 94 | +The comparison table shows trade-offs — not risks. |
| 95 | + |
| 96 | +- All modes are **valid and supported** |
| 97 | +- Choosing a different mode will not “break” security |
| 98 | +- Incompatible configurations will **fail fast** |
| 99 | + |
| 100 | +👉 You are always operating within a safe boundary. |
| 101 | + |
| 102 | +### 💡 Mental Model |
| 103 | + |
| 104 | +Think of auth modes as: |
| 105 | + |
| 106 | +> Different execution strategies — not different systems. |
| 107 | +
|
| 108 | +UltimateAuth remains consistent. |
| 109 | +Only the **behavior adapts**. |
| 110 | + |
| 111 | +<br> |
| 112 | + |
| 113 | +## 🔐 PureOpaque |
| 114 | +- Fully session-based |
| 115 | +- Every request validated on server |
| 116 | +- Maximum security |
| 117 | +- Touch semantics instead of refresh rotation |
| 118 | + |
| 119 | +👉 Best for: |
| 120 | + |
| 121 | +- Blazor Server |
| 122 | +- Internal apps |
| 123 | + |
| 124 | +## ⚡ Hybrid |
| 125 | +- Access token as opaque session id |
| 126 | +- Refresh token with rotate semantics |
| 127 | +- Server control with API performance |
| 128 | + |
| 129 | +👉 Best for: |
| 130 | + |
| 131 | +- Blazor WASM |
| 132 | +- Web + API systems |
| 133 | +- Full-stack apps |
| 134 | + |
| 135 | +## 🚀 SemiHybrid |
| 136 | +- JWT-based access |
| 137 | +- Server-side metadata control |
| 138 | + |
| 139 | +👉 Best for: |
| 140 | + |
| 141 | +- High-performance APIs |
| 142 | +- Zero-trust systems |
| 143 | + |
| 144 | +## 🌐 PureJwt |
| 145 | +- Fully stateless |
| 146 | +- No server-side session control |
| 147 | + |
| 148 | +👉 Best for: |
| 149 | + |
| 150 | +- External APIs |
| 151 | +- Microservices |
| 152 | + |
| 153 | +## 🎯 Which Mode Should You Use? |
| 154 | + |
| 155 | +| Scenario | Recommended Mode | |
| 156 | +|------------------------|------------------| |
| 157 | +| Blazor Server | PureOpaque | |
| 158 | +| Web + API | Hybrid | |
| 159 | +| High-scale API | SemiHybrid | |
| 160 | +| External microservices | PureJwt | |
0 commit comments