> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Team Members as Users

Deploying an application and running its business operations are separate
permissions. Application JWTs identify business callers; management credentials
administer deployments. Your provider account and application grants decide
which people can use your application.

## Use your application's identity provider

[Bijection Auth setup](https://docs.bijection.com/access/authentication/providers/bijection-auth#quick-start)
declares CLI sign-in. If you bring your own OIDC provider, declare CLI sign-in
on its public client. Browser sign-in for the console is optional and has its
own registered callbacks.

```ts bijection/sign-in.ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { issuer } from "@bijectionhq/bijection";

export const signIn = issuer.oidc({
  cli: { scopes: ["openid", "profile", "email"] },
  browser: {
    redirectUris: ["https://console.bijection.com/connections/callback"],
    scopes: ["openid", "profile", "email"],
  },
});
```

Place this export in the app tree in `bijection/app.ts`. After deploying, trust
the provider's values for it with
`bijection issuer trust signIn --issuer-url https://sso.example.com/ --audience your-public-client-id`.
Trusting an issuer issues a grant that carries `attest` for that issuer and
its values. Only the installation's identity admin issues it, never code: no
deploy and no `bijection env set` changes it. Each identity that signs in
through the issuer is bound by a grant under the trust that carries `speak`
for its principal, and each session is a grant under that binding, so
revoking the trust ends every binding and session under it.

Select CLI or browser sign-in, or both, on exactly one admitted OIDC provider.
Scopes default to `openid profile email offline_access`; each capability can
declare its own scopes, including `openid`. A CLI-only client requires no
console callback. Register authorization-code flow with PKCE S256 and the
callbacks of the capabilities you choose: HTTPS for the console, and the CLI's
`http://127.0.0.1:<ephemeral-port>/connections/callback` loopback redirect. The
browser also needs the provider's discovery and token endpoints to allow the
console origin. No client secret belongs in this declaration or the CLI. Use the
same client as the app so providers using pairwise subjects do not give the
person a different subject. A provider that cannot support these public-client
flows cannot serve this sign-in path.

For a non-production deployment, the native CLI can use the deployment's own
OIDC issuer at `http://127.0.0.1:<site-port>/auth` or
`http://localhost:<site-port>/auth`. Its HTTP authorization URL must share the
issuer's origin. Non-production browser registrations can use either loopback
host with an explicit port and the exact `/connections/callback` path. For
local CLI sign-in, pass `--url` with the installation API origin, including its
port. The CLI binds each sender proof to that selected host, port and request
path using the native receiver's HTTPS canonical URI.

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection session login --installation my-app:dev
bijection auth whoami --installation my-app:dev
```

The console offers **Sign in to your application** when browser sign-in is
declared. Both clients verify the returned token through the deployment and keep
the exact issuer and subject on renewal. A refused application login never falls
back to a management identity. Use the principal reported by
`bijection auth whoami` when issuing a role grant.

![Staff provider sign-in](https://mintcdn.com/bijection-95ba84d3/MXGsXPKmgvoqOVRN/screenshots/components_operation_identity_staff_sign_in.png?fit=max\&auto=format\&n=MXGsXPKmgvoqOVRN\&q=85\&s=767d1cbcaaf71cf0b3598dbffb5d7847)

## Provider tokens and permissions

For a provider using your application's browser sign-in, run
`bijection session login --app-url <application-url>`, which signs in through
the application's own sign-in page. Confirm the selected account
and deployment before permitting the CLI to retain its verified token in a
private cache. `auth status` describes that cache without refreshing;
`auth whoami` verifies the current token with the selected deployment.
`auth clear-local-credentials` removes the selected CLI session without signing
out other application or provider sessions. Browser tokens have no refresh
token; use explicit sign-in again after expiry.

Headless callers can supply a current application JWT through
`BIJECTION_ACCESS_TOKEN_FILE` (a private file containing the raw JWT). Keep
provider secrets out of source and browser code. Refresh tokens using your
provider's SDK; the CLI's OIDC flow refreshes its own selected session.

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
BIJECTION_ACCESS_TOKEN_FILE=/private/app-token bijection mutate invoices.send '{"invoice":"..."}' --url https://your-deployment.bijection.cloud
```

The call is admitted like any client call: the caller's surviving grants
must hold a role in the function's `allow` and clear its label, and guards may refuse a grant.
Grants and revocations are grave acts (`ctx.grant`, `ctx.revoke` in a
mutation) that need a grant whose role may issue the role and holds its
rights.
Deployment administration installs source and configuration; it does not confer
application roles. Operation execution requires a verified application identity
and the application's grants. Administrative impersonation remains available for
ordinary function debugging, and cannot supply operation authority. Branches use
parent authentication and separate branch admission. Logout does not invalidate
JWTs already issued by a provider; expiry and any revocation the application applies
determine their lifetime.

### Offline sessions

`bijection auth status` inspects the local credential record; it does not verify
a current identity or permission. `auth whoami` contacts the deployment to
verify the selected identity. `auth clear-local-credentials` removes the
selected local credentials. Status and local clearing require no provider or
management request. A named selector is available offline after a login has
retained its coordinates in the same private session record; otherwise specify
`--url`. Ambiguous retained coordinates refuse. Changing an unqualified
management-account scope requires selecting and signing in again. Provider
sessions and application grants remain under their owners.

### Clearing credentials and revoking sessions

`auth clear-local-credentials` works offline and removes this CLI's selected
credentials. Use `--format json` for its explicit result and the last verified
access-token expiry. It does not invalidate copies of a token or end the
provider session.

`auth revoke-session` and `auth revoke-all-sessions` request different provider
operations. The generic OIDC adapter reports `unsupported` and retains local
credentials; use the provider's session controls. An access JWT already issued
can remain usable until its expiration, even after a provider session ends.

The management console owns its Bijection sessions. **Sign out** ends this
console session; **Sign out everywhere** ends your console and management CLI
sessions atomically. **Sign out and end provider session** additionally requests
WorkOS logout and reports when that separate step cannot be confirmed. Your
profile lists active sessions and lets you end an individual device.

In the management CLI, use `bijection logout`,
`bijection logout --everywhere`, `bijection account session list`, or
`bijection account session end <id>`. `account clear-local-credentials` works
offline and clears only this machine's credentials. Access and refresh
credentials stay in the operating system keychain unless
`BIJECTION_CREDENTIAL_STORE=file` was chosen at login; copied access credentials end with their Bijection
session or their short expiry. Sessions require fresh sign-in after eight hours.
Application sign-in remains a separate identity boundary.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.