Connection
Connect to the WebSocket endpoint for the region of your Tenant.Region | API URL |
---|---|
US (Oregon) | wss://api-ws.authsignal.com/ws-v1-challenge |
AU (Sydney) | wss://au.api-ws.authsignal.com/ws-v1-challenge |
EU (Dublin) | wss://eu.api-ws.authsignal.com/ws-v1-challenge |
Authentication
To authenticate with the WebSocket API, include the required values in theSec-WebSocket-Protocol
header:
authsignal-ws
- identifies the Authsignal WebSocket sub-protocol.- Exactly one of the following, depending on the type of challenge you are creating:
x.authsignal.tenant.<your-tenant-id>
- use when the challenge is anonymous (user is not known yet).x.authsignal.token.<token-from-track>
- use when the challenge is for a known user; supply the token returned by the track request.
Message Flow
The WebSocket communication follows this pattern:- Client connects to the WebSocket endpoint
- Client sends
CREATE_CHALLENGE
message to initiate a challenge - Server responds with
CHALLENGE_CREATED
confirmation - Server sends
STATE_CHANGE
messages as the challenge progresses through states
Challenge States
Challenges progress through the following states:unclaimed
- Challenge created but not yet claimed by a user (This state will not be included in the state change messages)claimed
- User has claimed the challenge on their deviceapproved
- User has approved the challengerejected
- User has rejected the challenge