@startuml
skinparam backgroundColor White
skinparam defaultFontColor Black
skinparam sequence {
  ArrowColor Black
  LifeLineBorderColor Black
  LifeLineBackgroundColor #F8F8F8
  ParticipantBorderColor Black
  ParticipantBackgroundColor #E9FCEB
}

title WebAuthn Related Origins - After (/.well-known/webauthn enabled)

actor User
participant "Browser\n(Origin: https://shop.example.co.uk)" as Browser
participant "Athena Auth\nRP ID: example.com" as Auth
participant "Passkey API\n/api/auth/passkey/*" as Passkey

User -> Browser: Start passkey sign-in
Browser -> Browser: navigator.credentials.get({ rpId: "example.com" })
Browser -> Auth: GET /.well-known/webauthn
Auth --> Browser: 200 { "origins": ["https://shop.example.co.uk"] }
Browser -> Browser: Related Origin Request validated
Browser -> Passkey: POST /api/auth/passkey/generate-authenticate-options
Passkey --> Browser: PublicKeyCredentialRequestOptions
Browser -> Passkey: POST /api/auth/passkey/verify-authentication
Passkey --> Browser: Session + Set-Cookie

@enduml
