Run sim --output json credentials providers list to inspect the provider’s fields and authentication requirements before creating a service-account credential. OAuth connection commands return a link that a person must open to authorize the connection.
sim credentials is also spelled sim credential.
These commands accept the global options.
Provider discovery and connections
List credential providers
Options
API request and response schemas: listCredentialProviders.
List credentials
Options
API request and response schemas: listCredentials.
Create a service-account credential using its discovered provider schema
OAuth login or personal API key required.
Arguments
Options
--credentials takes the provider's fields, or the keylessConfig from sim credentials keyless-subject (with the required fields filled in). Pass @path or @- to keep secrets out of shell history.
Keyless (workload identity) credentials take two steps.
Step 1: run sim credentials keyless-subject <providerId> --output json and configure your cloud to trust the printed issuer, audience, and subject. Its requiredConfigFields lists the values your provider's keylessConfig still needs.
The printed audience is the default. To have Sim sign tokens for your own audience instead, set audience in keylessConfig and trust that value. Google Cloud prints no audience: its default is the credential's own workload identity pool provider.
Step 2: add those values to keylessConfig and pass it to sim credentials create <providerId> --credentials @file.
The proof expires after 24 hours and works only for the user who requested it, with the same providerId. Sim holds the subject for you for 30 days until a credential saves it, so a trust configuration that takes longer to apply still works: renew the proof with sim credentials keyless-subject <providerId> --subject <subject>. The subject stays the same, and each renewal restarts the 30 days. Sim holds up to 20 unsaved subjects per person and provider in a workspace; issuing more drops the one shown least recently.
If creation reports WORKLOAD_IDENTITY_PROOF_EXPIRED, renew the proof and retry. If it reports WORKLOAD_IDENTITY_PROOF_INVALID, WORKLOAD_IDENTITY_SUBJECT_REQUIRED, WORKLOAD_IDENTITY_SUBJECT_IN_USE, run step 1 again, trust the new subject, and retry.
Examples
API request and response schemas: createServiceAccountCredential.
Create a short-lived link for connecting an OAuth provider
OAuth login or personal API key required.
Arguments
Options
API request and response schemas: createCredentialConnection.
Create a short-lived link for reconnecting an OAuth credential
OAuth login or personal API key required.
Arguments
API request and response schemas: createCredentialConnection.
Update credential
OAuth login or personal API key required.
Arguments
Options
API request and response schemas: updateCredential.
Credential members
List credential members
OAuth login or personal API key required.
Arguments
Options
API request and response schemas: listCredentialMembers.
Upsert credential member
OAuth login or personal API key required.
Arguments
Options
API request and response schemas: upsertCredentialMember.
Remove credential member
OAuth login or personal API key required.
This revokes the selected user’s explicit credential grant.
Arguments
Options
API request and response schemas: removeCredentialMember.
Disconnect credentials
Disconnect credential
OAuth login or personal API key required.
This disconnects the credential and removes its stored authentication.
Arguments
Options
API request and response schemas: deleteCredential.
Other commands
Issue the subject and proof for a new keyless (workload identity) credential
OAuth login or personal API key required.
Arguments
Options
Keyless (workload identity) credentials take two steps.
Step 1: run sim credentials keyless-subject <providerId> --output json and configure your cloud to trust the printed issuer, audience, and subject. Its requiredConfigFields lists the values your provider's keylessConfig still needs.
The printed audience is the default. To have Sim sign tokens for your own audience instead, set audience in keylessConfig and trust that value. Google Cloud prints no audience: its default is the credential's own workload identity pool provider.
Step 2: add those values to keylessConfig and pass it to sim credentials create <providerId> --credentials @file.
The proof expires after 24 hours and works only for the user who requested it, with the same providerId. Sim holds the subject for you for 30 days until a credential saves it, so a trust configuration that takes longer to apply still works: renew the proof with sim credentials keyless-subject <providerId> --subject <subject>. The subject stays the same, and each renewal restarts the 30 days. Sim holds up to 20 unsaved subjects per person and provider in a workspace; issuing more drops the one shown least recently.
If creation reports WORKLOAD_IDENTITY_PROOF_EXPIRED, renew the proof and retry. If it reports WORKLOAD_IDENTITY_PROOF_INVALID, WORKLOAD_IDENTITY_SUBJECT_REQUIRED, WORKLOAD_IDENTITY_SUBJECT_IN_USE, run step 1 again, trust the new subject, and retry.
Examples
API request and response schemas: createCredentialWorkloadIdentitySubject.