┌────────┐ ┌────────┐ │Server A│ │Server B│ └────┬───┘ └────┬───┘ │ │ ╔══╧══════════════════════════════════════════════╧══╗ ═══════╣ Server A wants to prove its identity with Server B ╠═══════ ╚══╤══════════════════════════════════════════════╤══╝ │ │ │ ""GET"" Server B auth │ │ ""?phase=dialback"" │ │ ""?target="" │ │─────────────────────────────────────────────>│ │ │ │ 202 Accepted / 204 No content │ │<─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─│ │ │ . . . Potentially some delay . . . . . . . │ ""POST"" Server A dialback │ │ ""origin=Server B domain"" │ │ ""secret="" │ │<─────────────────────────────────────────────│ │ │ │ 202 Accepted / 204 No content │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ >│ │ │ │ ""GET"" Server B auth │ │ ""?phase=token"" │ │ ""?secret="" │ │─────────────────────────────────────────────>│ │ │ │ 200 Ok / 201 Created │ │ {{json │ │ { │ │ "token": "", │ │ "expires": "" │ │ } │ │ }} │ │<─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─│ │ │ │ │ │ ╔═══════════════════════╗ │ ══════════╪══════════╣ Authenticated request ╠═══════════╪══════════ │ ╚═══════════════════════╝ │ │ │ │""GET"" Server B whatever │ │ <&header> ""Authentication: Bearer "" │ │─────────────────────────────────────────────>│ │ │ │ │ │<─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─│ │ │ │ │ │ ╔═════════════════════════════════════╗ │ ══════════╪═══╣ Server A wants to refresh the token ╠════╪══════════ │ ╚═════════════════════════════════════╝ │ │ │ . . . A bit before the expires date . . . . . . . │""GET"" Server B auth │ │ ""?phase=refresh"" │ │ <&header> ""Authentication: Bearer "" │ │─────────────────────────────────────────────>│ │ │ │ 200 Ok / 201 Created │ │ {{json │ │ { │ │ "token": "", │ │ "expires": "" │ │ } │ │ }} │ │<─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─│ ┌────┴───┐ ┌────┴───┐ │Server A│ │Server B│ └────────┘ └────────┘