Skip to content
Check Out and Check In

Check Out and Check In

Overview

Checkout is the core workflow in PyBritive. When you check out a profile, Britive grants your identity temporary credentials to a cloud account or resource. When you are done, you check in to revoke that access — no standing privileges remain.

What you’ll learn:

  • How to check out a profile and retrieve temporary credentials
  • How to view credentials in different formats
  • How to create an alias for a profile you use frequently
  • How to extend an active checkout
  • How to check in a profile when you are done

Before You Begin

Note: Profile names in this tutorial are from the Britive demo tenant. Replace them with your own profile names from pybritive ls profiles.

Check Out and Check In a Profile

Check out a profile

Use the profile name returned by pybritive ls profiles. Profile names follow the format Application Name/Environment Name/Profile Name.

pybritive checkout "AWS SE Organization/696226360299 (se-demo)/S3 Bucket Admin"

By default, PyBritive prints the temporary credentials to your terminal. Keep the profile name in quotes to handle spaces correctly.

View credentials in different formats

Use the --mode flag to control how credentials are returned.

Environment variables (Linux/macOS):

pybritive checkout "AWS SE Organization/696226360299 (se-demo)/S3 Bucket Admin" --mode env

This outputs export statements you can evaluate directly in your shell:

eval $(pybritive checkout "AWS SE Organization/696226360299 (se-demo)/S3 Bucket Admin" --mode env)

Environment variables (Windows Command Prompt):

pybritive checkout "AWS SE Organization/696226360299 (se-demo)/S3 Bucket Admin" --mode env-wincmd

Environment variables (Windows PowerShell):

pybritive checkout "AWS SE Organization/696226360299 (se-demo)/S3 Bucket Admin" --mode env-winps

JSON:

pybritive checkout "AWS SE Organization/696226360299 (se-demo)/S3 Bucket Admin" --mode json

Create a profile alias

If you check out the same profile regularly, create an alias so you don’t have to type the full profile name each time.

pybritive checkout "AWS SE Organization/696226360299 (se-demo)/S3 Bucket Admin" --alias s3-admin

Future checkouts can use the alias instead of the full profile path:

pybritive checkout s3-admin

Extend an active checkout

If your session is approaching expiry and you need more time, extend it without checking in and back out:

pybritive checkout "AWS SE Organization/696226360299 (se-demo)/S3 Bucket Admin" --extend

Check out a profile that requires approval

Some profiles require manager or admin approval before credentials are issued. When you check out one of these profiles, PyBritive waits and polls for approval automatically.

Provide a justification when prompted, or pass it directly with the --justification flag:

pybritive checkout "Sigma Prod/724271230776/Prod Admin" --justification "Investigating production incident #1234"

PyBritive will wait up to 10 minutes by default for approval. You can adjust the maximum wait time:

pybritive checkout "Sigma Prod/724271230776/Prod Admin" \
  --justification "Investigating production incident #1234" \
  --maxpolltime 300

If you do not want the command to block, use pybritive request submit instead — covered in Approval Workflows.

Check in a profile

When you are done, check in to revoke your temporary credentials:

pybritive checkin "AWS SE Organization/696226360299 (se-demo)/S3 Bucket Admin"

Or using an alias:

pybritive checkin s3-admin

To confirm the profile has been checked in, run:

pybritive ls profiles --checked-out

The profile should no longer appear in the list.

Troubleshoot

SymptomCauseFix
Profile not foundProfile name typo or wrong formatRun pybritive ls profiles and copy the exact name
Checkout hangs indefinitelyProfile requires approval, approver not respondingPress Ctrl+C to cancel; contact your approver
Already checked outProfile is still activeRun pybritive checkin first, then checkout again
Credentials expired immediatelyClock skew between machine and BritiveSync your system clock

Next Steps

  • AWS Credentials — use checkout modes specific to AWS, including credential_process and console access
  • GCP Credentials — authenticate to GCP using gcloudauth and gcloudauthexec modes
  • Approval Workflows — submit, approve, and reject access requests without blocking your terminal
Last updated on