-
Notifications
You must be signed in to change notification settings - Fork 1
authentication
David Robinson edited this page Mar 25, 2016
·
12 revisions
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"}
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:
Make the request to connection with the following query parameters:
id_token: user's id_token
connection_id: the connection id from the websocket
{"message":"Authenticate","value":"[email protected]"}
Wait for the Authenticated message:
{"message":"Authenticated"}
now you are ready to go