Skip to content
David Robinson edited this page Mar 25, 2016 · 12 revisions

Step 1, make web socket connection

First, you can open the socket connection

wss://api.thepathfinder.xyz

The server then sends a connection id message

{ "message":"ConnectionId",
  "id":"this is a unique identifier"}

Step 2, Make Connection Request

Using a Pathfinder Authentication JWT

After receiving this message, a post request with the following jwt should be made to authentication-server/connection, the jwt should go in the query string with key 'token;

{
   "alg":"RS256",
   "typ":"JWT"
}
{
   "iss":"my_app_id",
   "sub":"connection id",
   "aud":"https://auth.thepathfinder.xyz",
   "exp":12345678,
   "email":"[email protected]"
}

It should be signed using your application secret given to you when you create the app. Upon receiving an OK response, send the authenticate message through the web socket:

Using a Google openid connect id token

Make the request to connection with the following query parameters:

id_token: user's id_token
connection_id: the connection id from the websocket

Step 3: Send Authenticate Message

{"message":"Authenticate","value":"[email protected]"}

Wait for the Authenticated message:

{"message":"Authenticated"}

now you are ready to go