User Tokens
User Tokens are issued by the API implementer to access User scoped resources, i.e. Projects, Baskets. Externally issued User Tokens can also be used to in the place of an Application Token.
Details
A User Token is made up of the following required fields.
Name | Description | Data Type | Information | Example |
---|---|---|---|---|
iss | Issuer | String | The agreed identifier of the system issuing the token | application.example.com |
aud | Audience | String | The target MILK API environment | api.milkbooks.com |
exp | Expiry | UNIX Timestamp | The time that this token should expire | 1374112588 |
sub | Subject | String | The permanent unique identifier of the user in the external system | 1234 |
Email Address | String | The users current email address | joe@blogs.com |
Example
The above example fields put together as a token (without base64 encoding and signing)
{"typ":"JWT","alg":"HS256"}.{"iss":"application.example.com","aud":"api.milkbooks.com","exp":1374112588,"sub":"1234","email":"joe@blogs.com"}
With encoding and signed (with 'secret')
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcHBsaWNhdGlvbi5leGFtcGxlLmNvbSIsImF1ZCI6ImFwaS5taWxrYm9va3MuY29tIiwiZXhwIjoxMzc0MTEyNTg4LCJzdWIiOiIxMjM0IiwiZW1haWwiOiJqb2VAYmxvZ3MuY29tIiwidHlwIjoiSldUIn0.9UhWbNwV23esh5L3Du65nG_CQdGaBQ5bEuH77U-INEI