Skip to main content
A plugin can sign a user in with OAuth 2.0, then list which of its installations and repositories that user can use. Your plugin is its own OAuth client: it authenticates with the keys it already registered, and needs no client secret. The Plugin OAuth user token is the access token returned by this sign-in flow. It is distinct from a User token, the own-account bearer described in Authentication. It tells your plugin who the user is and which of its installations and repositories they can access; it does not authorize repository work. To read code or report checks, you still mint a Plugin installation token with your plugin JWT.

What you need

  • OAuth redirect URIs. Ask your Entire contact to add up to 10 HTTPS OAuth redirect URIs when you register your plugin, or later. Entire compares them character for character. Without them, your plugin isn’t an OAuth client.
  • Your client ID, which Entire gives you when it adds the OAuth redirect URIs. It looks like plugin_01M5.... It never changes, isn’t a secret, and doesn’t depend on your slug.
  • Your plugin’s key, the same one you sign plugin JWTs with.

Sign the user in

Sign-in is the authorization code flow, with PKCE required. Send the user to auth.entire.io, which forwards them to the Core that holds their account:
The first time, the user approves your plugin on a consent page that shows your name and logo. Later sign-ins skip the page until the user revokes it. Core then redirects to your redirect_uri with code, state and iss (RFC 9207). iss names the Core that issued the code, such as https://eu.auth.entire.io. Check that it’s one of Entire’s Cores.
  • Core refuses a request without a PKCE challenge, and a request with a nonempty resource parameter.
  • scope must be present, but Core ignores its value. Every plugin gets openid offline_access.
  • Tie state to the browser session that started the sign-in, and check it on the redirect.

Redeem the code

Redeem the code at the Core named by iss. auth.entire.io has no token endpoint. Authenticate with a client assertion (RFC 7523) in place of a client secret:
The assertion is a JWT signed with your plugin’s key: The response carries access_token (the Plugin OAuth user token), id_token and refresh_token. To refresh, send grant_type=refresh_token and the refresh token to the same Core, with a new assertion. Refresh tokens rotate: each refresh returns a new one, so store the latest. Only the token endpoint accepts the assertion. Basic auth and a missing assertion answer 401 invalid_client.

What the tokens contain

The Plugin OAuth user token’s audience is entire:plugin-api, so it works only on the user routes below. Every other /api/v1 route refuses it. /userinfo returns sub and, when available, preferred_username and handle. Treat provider and provider_user_id as opaque.

List what the user can use

Two routes accept the Plugin OAuth user token as a bearer credential on its issuing Core or a configured trusted sibling Core. See When access ends for differences in revocation checks. First, your active installations in projects the user can read:
repository_selection is all or selected. Then the installation’s repositories that the user can pull:
Both take per_page, from 1 to 100, default 30. While the response has a next_cursor, pass it back as ?cursor= for the next page. The last page has no next_cursor. A repositories page can be short, or empty, while next_cursor is still set, because Entire filters each page for the user. Keep paging until there’s no cursor. If the installation changes during a repository-page walk, you get 409 conflict: restart that repository walk from the first page. The installations list does not use this revision-bound pagination. The list leaves out installations the user reaches only through grants on single repositories, without read access to the project.

Act for the user

  1. Sign the user in, and list the installations and repositories they can use.
  2. Let the user pick a repository from that list.
  3. Mint a Plugin installation token for that installation with your plugin JWT, scoped to the repository.
  4. Before each later action you take for the user, check their access through the user routes again.

When access ends

Revoking the plugin ends the user’s refresh-token family and makes the next sign-in show consent again. The issuing Core checks that family when accepting access tokens, with a five-second cache. A trusted sibling Core does not perform that live family check, so do not rely on immediate access-token revocation across all Cores. Removing all OAuth redirect URIs blocks new sign-ins and refresh grants; it does not by itself immediately invalidate already issued access tokens. Account suspension or removal can also cause access checks or refreshes to fail. A 401 with detail “the account is not active” means the user lost access. Don’t retry it; ask the user to sign in again.

Which Core to call

Start every sign-in at auth.entire.io, not at a specific Core such as https://eu.auth.entire.io: it forwards the user to the Core that holds their account. Redeem and refresh at the Core named by iss, and set the assertion’s aud to it. Your registration is shared across Cores, but accepting a sibling-issued Plugin OAuth user token requires configured trust. Prefer the issuing Core when you need its live refresh-family revocation check.

Errors

These are for the user routes. Error bodies are RFC 9457 problem documents, with a machine-readable code member.