-
Notifications
You must be signed in to change notification settings - Fork 0
Auth Flows with central server
hammy3502 edited this page Oct 26, 2021
·
3 revisions
NOTE: All requests made should be application/json
-
client
/server
sendscentral-server
(at any endpoint), ausername
,password
, and theauth
key set to "password". -
central-server
will return a token inside of thetoken
key. Note that this response does NOT include the requested data. -
client
/server
sendscentral-server
(at any endpoint), atoken
retrieved from step 2 (hereby called a perma-token) and theauth
key set to "perma_token". -
central-server
will return a different token (hereby called a temporary-token) inside of thetoken
key. - The temporary-token can be used with the
auth
key set to "temp_token" to send and receive data.
-
client
/server
sendscentral-server
(at any endpoint), ausername
,password
, and theauth
key set to "password". -
central-server
responds with a HTTP code 401, and amessage
key of "Unauthorized!"
- Perma-tokens are never automatically revoked, and can only be revoked manually (those with the permission
revoke_tokens
). This is the ideal thing to save to disk (such as in a cookie), as it isn't the direct username and password of the user, while it still acts as a permanent method of authentication. - Temporary tokens are automatically revoked after 24 hours, at which point they will fail to authenticate with the server.