BDG-00: Establish Session
Use Case: Establish BadgeOS Session
Before the API calls can be made to BadgeOS, the server needs to present its credentials as the application so the BadgeOS system will allow operations to be performed. The default implementation on WordPress is a set of cookies.
Actors
- The Main Server is the initiator of sessions.
- BadgeOS responds to requests to initiate sessions.
Pre-Conditions
- Both systems must be available on the network.
- TLS sessions must be enabled to avoid sending credentials in plain text.
Steps
- Post to the Login screen with the following values: (Details taken from Postman under "Login WP" collection and the "How To" entry.)
- account name
- password
- request for Test Cookie (establishes that the client is paying attention to cookies?)
- The response will contain a set of cookies which establish the session
Alternative Paths
A nonce is also required and is used for subsequent requests. There may be multiple nonces within the body of the response. Which nonce to use depends on the action being taken. A map of these nonces may address the full range of the API we want to use.
Post-Conditions
- Full set of required cookies are set.
- Optional: Map of the Nonces to be used for awarding, revoking, and so on. This is optional because it may make more sense to obtain the nonce at the time the call is being made.
References
ref1
Implementation Detail: The cookies are valid for some period of time and then need to be refreshed. The procedure for when and how to refresh remains open.
page revision: 2, last edited: 23 Jul 2019 21:03