User Tokens

User Tokens are issued by the API implementer to access User scoped resources, i.e. ProjectsBaskets. 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.

NameDescriptionData TypeInformationExample
issIssuerStringThe agreed identifier of the system issuing the tokenapplication.example.com
audAudienceStringThe target MILK API environmentapi.milkbooks.com
expExpiryUNIX TimestampThe time that this token should expire1374112588
subSubjectStringThe permanent unique identifier of the user in the external system1234
emailEmail AddressStringThe users current email addressjoe@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