1. Create your OAuth app
An OAuth app is the client ID and the client secret of your product.
A product on a device calls boat directly. A web product calls boat from its server: boat does not answer browser requests from another site.
2. Send the person to boat
Make a randomcode_verifier and its SHA-256 hash, the code_challenge (PKCE). Keep the verifier.
Check that
state is the value you sent.
3. Get the tokens
The code works once, for 5 minutes.client_secret out.
4. Call the API
Use the access token like an API key:403. Read scope errors.
5. Refresh
The access token lasts 1 hour. Then:Scopes
Ask for the smallest set. The person sees each one.
Each scope stands alone: no scope includes another, except that
sandbox.delete covers sandbox.delete-own.
environment.read with exec or with environment.write also reads environment secrets. boat then adds environment.values.read to the request, shows it to the person, and returns it in scope.
Your product can never create API keys, change sign-in methods or delete the account.
The person can also limit your product:
Manage OAuth apps
These commands need a browser login (
boat login), not an API key.
- Disconnect stops the tokens of the product at once.
- Delete disconnects every user of your product.
- Your product can also give up its own access:
curl -sS https://boat.dev/api/boat/oauth2/revoke -d token="$REFRESH_TOKEN"
Reference
Token errors are
{"error": "...", "error_description": "..."}:
Limits: 10 OAuth apps per account, 10 redirect URIs per OAuth app. boat matches the redirect URI exactly, except the port of a
localhost URI. An OAuth app name cannot contain “boat”.
Keep the client secret and the refresh tokens on your server. Never put a token in a URL or a log.