Skip to Content
Xeonr Developer Docs
Access and tokens

Third-party applications

Integrate with branchd over OAuth, asking for the least scopes and resources you need.

An application that acts for branchd users signs them in with Xeonr Auth and calls branchd with the access token. branchd gives a third-party token exactly the scopes it was granted, never more, and always within the person's own role.

Ask for the least

  • Ask for feature scopes, not levels: forge:contents:read to clone, forge:package:read to pull images, forge:check:edit to report a check. See Scopes and levels.
  • Name the scopes you can't work without in required_scope. The person may untick the rest.
  • Limit to resources when you can. Push authorization_details through PAR, with resource=https://branchd.run:
[
  { "type": "forge:repository", "identifier": "acme/api", "actions": ["forge:contents:read"] },
  { "type": "forge:group", "identifier": "acme/docs", "actions": ["forge:contents:read", "forge:pull-request:edit"] }
]

Each action must be one of the scopes you asked for, or implied by one.

Read what was granted

The person may untick scopes, drop resources you pushed, or limit an unlimited request to some groups and repositories on the consent screen. Read the scope and authorization_details in the token response, and build your UI from those. See What the person grants.

A request outside the token's resources is refused, even where the person's own role would allow it.

On this page