-
Notifications
You must be signed in to change notification settings - Fork 1
authentication
Daniel edited this page Mar 19, 2016
·
12 revisions
You pass a jwt signed by your pathfinder secret as a query parameter to the websocket request header:
{ "alg":"HS256", "typ":"JWT" }
body:
{ "application_id":"my app id",
"id_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.Rq8IxqeX7eA6GgYxlcHdPFVRNFFZc5rEI3MQTZZbK3I",
"expires":12345678
"permissions":["cluster1", "cluster2", "cluster3"]
}
you can then open the socket connection
wss://api.thepathfinder.xyz?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcyI6ImFzZGYiLCJzdWIiOiIxZTIzNDU2Nzg5MCJ9.JWW-A64Q_xwkSt5XTD1UHnzDDFOB6DGga_CdMBx-QLE
The server then sends a connection id message
{ "message":"ConnectionId",
"id":"this is a unique identifier"}
After receiving this message, the connection id should be sent to the auth server
make a get request to auth-server/connection with the connection id as an argument
if you get an ok response then the websocket is ready to use