sequenceDiagram
participant PLC as PLC / DID Host
participant ID as Identity / Handle Resolution
participant Client as Client App
participant User as User/Browser
participant AS as Authorization Server
(PDS/Entryway)
participant CIMD as CIMD Document
participant RS as Resource Server
(PDS)
Note over ID: Typically over DNS or HTTP, but could
also be a caching server like slingshot.
Note over Client,RS: 1. Identity Resolution Phase
Client->>Client: Start with Handle/DID
or Server URL
Client->>ID: Resolve Handle → DID
ID->>Client:
Client->>PLC: Fetch DID Document
PLC->>Client: Retrieve PDS Service from DID Document
Client->>RS: Fetch OAuth Protected
Resource Metadata
from PDS Service
RS->>Client: Retrieve Authorization
Server URL
Client->>AS: Fetch Authorization
Server Metadata
Note over Client,RS: 2. Authorization Request (PAR)
Client->>Client: Generate PKCE code_verifier
& code_challenge
Client->>Client: Generate DPoP keypair
& state token
Client->>AS: POST PAR with:
- code_challenge
- scopes (atproto)
- redirect_uri
- login_hint (optional)
- client_assertion (confidential)
AS-->>Client: Error: DPoP nonce required
Client->>AS: Retry PAR with DPoP nonce
AS-->>Client: Returns request_uri
Note over Client,RS: 3. User Authorization
Client->>User: Redirect to Authorization
Endpoint with request_uri
AS->>AS: Authenticate User
AS->>CIMD: Fetch Client ID
Metadata Document
CIMD->>AS:
User->>AS: Approve
AS->>User: Redirect to redirect_uri
with code, state, iss
Note over AS: OR
User->>AS: Deny
AS->>User: Redirect if redirect_uri is
valid for client
with error=access_denied
Note over Client,RS: 4. Token Request, unless error parameter
User->>Client: Callback with code
Client->>Client: Verify state matches
Client->>Client: Verify iss matches AS URL
Client->>AS: POST Token Request:
Note over Client,AS: Sends:
- code
- code_verifier (PKCE)
- DPoP proof
- client_assertion (confidential)
AS-->>Client: Token Response
Note over AS,Client: Returns:
- access_token
- refresh_token
- sub (DID)
-Expiry Info
Client->>Client: Verify sub DID matches
expected account DID
Note over Client,RS: 5. Resource Access
Client->>RS: Request Resource with:
- DPoP proof (with auth)
- access_token
RS-->>Client: Error: DPoP nonce required
Client->>RS: Retry with DPoP nonce
RS-->>Client: Returns Resource
Note over Client,RS: 6. Token Refresh (when expired, or near expiring)
Client->>AS: POST Token Refresh
Note over Client,AS: Sends:
- refresh_token
- DPoP proof
- client_assertion (confidential)
AS-->>Client: Returns new tokens