setup_sequence.txt (970B)
1 sequenceDiagram 2 participant Client 3 participant OAuth2 Gateway 4 participant OAuth2 Gateway DB 5 6 Client ->> OAuth2 Gateway: POST /setup/{client_id}\n{scope: "first_name last_name"} 7 8 OAuth2 Gateway ->> OAuth2 Gateway: generate_nonce()\n(256-bit CSPRNG) 9 10 OAuth2 Gateway ->> OAuth2 Gateway DB: INSERT INTO verification_sessions\n(client_id, nonce, scope, expires_at)\nSELECT c.id, $1, $2, NOW() + INTERVAL '15 minutes'\nFROM clients c WHERE c.client_id = $3\nRETURNING id, nonce, expires_at 11 12 alt Client not found 13 OAuth2 Gateway DB -->> OAuth2 Gateway: 0 rows 14 OAuth2 Gateway -->> Client: 404 NOT FOUND\n{error: "client_not_found"} 15 else DB error 16 OAuth2 Gateway DB -->> OAuth2 Gateway: Error 17 OAuth2 Gateway -->> Client: 500 INTERNAL SERVER ERROR 18 else Success 19 OAuth2 Gateway DB -->> OAuth2 Gateway: session {id, nonce, expires_at} 20 OAuth2 Gateway -->> Client: 200 OK {nonce} 21 end