Token Anatomy
import { Token } from 'webdaemon'
Tokens are placed in the X-Tabserver-Token header of requests.
Each token is base64-encoded JSON containing the following fields:
audthe agent receiving the request.- Expressed as an origin, such as
https://receiver.agent.id. - The receiver host is known as the party, in this case
receiver.agent.id.
- Expressed as an origin, such as
subthe agent sending the request.- Expressed as an origin, such as
https://sender.agent.id. - The sender host is known as the counterparty, in this case
sender.agent.id.
- Expressed as an origin, such as
issURL of the sending agent’s public key.- Used to validate the token by the receiver.
- Origin must equal
sub.
srcURL of the app that is responsible for generating this token.- Agent apps are all identified by the HTML page that defines them.
scoperequested capabilities, keyed by receiving app URL, on the receiving agent.- Each app installed on the receiver can define and grant its own capabilities.
- The sender may request capabilities, but that doesn’t mean they’re granted.
iatthe time the token was generated by the sender.expthe expiry time of the token, as determined by the sender.sigthe sender’s signature.- The signature is generated using all non-
sigfields. - It is checked by the receiver using the
issfield.
- The signature is generated using all non-