Skip to content

credctl auth

Terminal window
credctl auth [flags]

credctl auth signs a JWT with the hardware-bound Secure Enclave key and exchanges it for short-lived cloud credentials. Touch ID prompts you to authorise the signing operation.

Supports AWS (default) and GCP via the --provider flag.

If the credential daemon is running, credctl auth returns cached credentials instantly without Touch ID. If the daemon is not running, it falls back to the normal direct path. This is transparent — no flags or configuration changes needed.

Progress messages are written to stderr. Credential output goes to stdout.

FlagTypeDefaultDescription
--providerstringawsCloud provider: aws or gcp.
--formatstringvariesOutput format. AWS: credential_process (default) or env. GCP: executable (default) or env.

Default output (credential_process format)

Section titled “Default output (credential_process format)”
Terminal window
credctl auth
{
"Version": 1,
"AccessKeyId": "ASIAI...",
"SecretAccessKey": "...",
"SessionToken": "...",
"Expiration": "2026-03-04T12:30:00Z"
}

Configure as an AWS credential process:

[profile credctl]
credential_process = credctl auth

credctl setup aws configures this automatically.

Terminal window
eval $(credctl auth --format env)
aws s3 ls
Terminal window
credctl auth --provider gcp
{
"version": 1,
"success": true,
"token_type": "urn:ietf:params:oauth:token-type:jwt",
"expiration_time": 1709800300,
"subject_token": "eyJhbGciOiJFUzI1NiIs..."
}

This format is used by GCP client libraries via the credential config file generated by credctl setup gcp.

Terminal window
eval $(credctl auth --provider gcp --format env)
gcloud storage ls

Sets CLOUDSDK_AUTH_ACCESS_TOKEN with a short-lived OAuth2 access token. This format does the full two-step exchange (STS + service account impersonation) within credctl.

CodeMeaning
0Credentials retrieved successfully
1Error (device not initialised, cloud provider not configured, exchange failure, or other error)