CLI guide
GitHub

Signing in

Sign in

source-coop auth login

This opens your browser. After you sign in, the CLI keeps the session in your OS keyring, or in a file if there is no keyring. The old name, source-coop login, also works.

One session is used for all commands:

The CLI renews expired tokens and credentials. You sign in again only when the session itself expires.

Sign-in uses the OAuth2 Authorization Code flow with PKCE. The CLI then exchanges the OIDC ID token at the proxy's STS endpoint for temporary AWS credentials. Two flags change this:

Sign in on a remote server (no browser)

auth login receives the browser's redirect on a local port. On a server without a browser, forward that port over SSH:

  1. Connect with a port forward. Any free port is satisfactory; this example uses 8400:

    ssh -L 8400:127.0.0.1:8400 user@server
    
  2. On the server, sign in on the forwarded port:

    source-coop auth login --port 8400
    
  3. Open the URL that the CLI prints in your local browser, and sign in. The redirect to http://127.0.0.1:8400/callback goes through the tunnel to the CLI on the server.

The session stays on the server (see File fallback). source-coop creds renews the credentials there without a browser.

See your sign-in status

source-coop auth status
auth status, then --json

auth status shows:

It reads only the cache. It does not renew tokens or use the network. On a terminal, the session's state is green or red.

When you must sign in again. The refresh token sets this. The CLI uses it to renew the other tokens and the credentials, so their expiry times do not matter. source.coop's identity provider (Ory) does not tell the CLI how long a refresh token lasts. Thus auth status shows:

If a provider gives an expiry time, auth status shows that time. After that time, the session shows as expired. After only the estimate, it shows as likely expired (yellow), because the real lifetime can be longer. A session from an older version shows yes until its next renewal.

With --json, auth status prints the same data:

source-coop auth status --json | jq -r .login.refresh_token.issued_at

auth status shows one environment and one role, because the keyring cannot list its entries. To see others, use --proxy-url and --role-arn (or SOURCE_PROXY_URL and SOURCE_ROLE_ARN).

Sign out

auth logout removes the session of one environment and the credentials of one role. It removes them from the keyring and from the file fallback.

source-coop auth logout
source-coop auth logout --proxy-url https://data.staging.source.coop --role-arn reader-role
source-coop auth logout --json   # {"proxy_url": …, "role_arn": …, "removed": {"session": true, "credentials": true}}

It uses --proxy-url (SOURCE_PROXY_URL) and --role-arn (SOURCE_ROLE_ARN), as creds does.

The keyring cannot list its entries, so the credentials of other roles stay. You can use them until they expire, but the CLI cannot renew them without the session. To remove them now, run auth logout --role-arn <role> for each role.

auth logout does not revoke tokens at the identity provider.

auth logout --json, then auth status and creds signed out