Login with device doesn't work with multiple replicas #5796
Unanswered
denysvitali
asked this question in
Q&A
Replies: 1 comment 2 replies
-
|
Vaultwarden doesn't support HA deployments. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Vaultwarden Support String
Your environment (Generated via diagnostics page)
Config & Details (Generated via diagnostics page)
Show Config & Details
Environment settings which are overridden: DOMAIN, ADMIN_TOKEN
(The rest of the config was omitted)
Vaultwarden Build Version
v1.33.2
Deployment method
Official Container Image
Custom deployment method
Vaultwarden deployed via a
Deploymentand connected to an PostgreSQL HA cluster (via CloudNativePG).Reverse Proxy
Traefik
Host/Server Operating System
Linux
Clients
Web Vault
Steps To Reproduce
Expected Result
User is able to log-in on the first try
Actual Result
User has to be "lucky" that the accepted authentication response ends up on the same instance as the client is listening on (websocket).
Additional Context
When deployed using Kubernetes, multiple replicas and using PostgreSQL - Login With Device is partially faulty.
It looks like the implementation of the
/anonymous-hubwebsocket server doesn't consider the fact that the accepted login message doesn't come from the same instance where the client is listening on.sequenceDiagram participant Client as Client Device participant AuthDevice as Authorizing Device participant PodA as Vaultwarden Pod A participant PodB as Vaultwarden Pod B participant DB as PostgreSQL Note over PodA,PodB: Kubernetes with multiple replicas Client->>PodA: 1. Connect to /anonymous-hub WebSocket PodA-->>PodA: 2. Create WebSocket connection Client->>PodA: 3. Send device login request PodA->>DB: 4. Store device_token in PostgreSQL PodA-->>Client: 5. Return verification text/fingerprint AuthDevice->>PodB: 6. Load approval page (different pod!) AuthDevice->>PodB: 7. Approve device login PodB->>DB: 8. Update token status to approved PodB-->>PodB: 9. Send approval notification Note over PodB: ❌ Problem: Notification sent within Pod B Note over Client,PodA: But client is connected to Pod A's WebSocket! Note over Client: Client never receives approval notification Note over Client: WebSocket times out or failsBeta Was this translation helpful? Give feedback.
All reactions