Before you start
Read Secrets first. Copy examples into Workbench and run the statements in order in the same session. Stop if a statement fails and inspect its output. Use unusedlearn_ names and replace example IDs, paths, regions, and URLs with values for your environment.
Examples with learn_files://... require an operator-configured file secret provider named learn_files. Its mapping must contain the named input and supply the format described below. Replace that reference with an actual provider reference or a local secret name if you use another secret store. No file is uploaded by this SQL.
File paths and runtime identities belong to the credential-service host, not the browser. Cloud roles, trust policies, identity bindings, and permissions must already exist. A consumer must support the kind of credential you select.
Choose a provider
OPTIONS contains public settings. SECRETS contains references, not secret plaintext. source names another credential. Source credentials must already exist and must not form a cycle.
AWS
All methods exceptsaved require region. Saved credentials provide keys; region and endpoint settings for their consumer belong on that consumer.
Saved AWS keys
Use an existing JSON key bundle from a secret provider. It must containaws_access_key_id and aws_secret_access_key. Optional fields are aws_session_token and expires_at_unix_millis. Short key aliases such as access_key_id are also accepted.
session_token for temporary keys; omit it for long-lived keys. Do not combine these fields with a bundle.
expires_at_unix_millis option sets an expiry for saved material. It does not renew keys. Replace expired values or use a method that obtains fresh credentials.
Default AWS credential chain
Use the AWS SDK credential sources available on the host. An optionalprofile selects a host profile.
Environment credentials
Set AWS credential environment variables on the credential-service host before using this method.Named profile
Install theanalytics profile on that host. SDK-supported SSO, process, and role profiles require their own tools and valid login state.
Container credentials
Use a runtime with a configured container credential endpoint, such as an ECS task role. ECS is Amazon Elastic Container Service.EC2 instance role
Attach an IAM role to the EC2 instance and make its metadata service available.IRSA
IRSA associates an EKS Kubernetes service account with an IAM role. Configure the role trust and injected token-file/role environment before use.EKS Pod Identity
Configure the EKS Pod Identity association and runtime credential endpoint. This method obtains container credentials; it does not create the association.AWS workload identity
Let the runtime choose IRSA when its token-file environment is present, then container identity, otherwise an instance role.role_arn and token_file. Do not provide only one:
Web identity
Exchange a web identity token for an AWS role session. The role must trust that token issuer and audience. Choose exactly one source: a token file, asubject_token secret, or a named token-producing credential.
token_file:
learn_gcp_attached from the Google section. Set the audience expected by the AWS trust policy. Laminar requests an ID token from that source.
Assume an IAM role
First createlearn_aws_default_chain above. Its identity must be allowed to assume this role, and the target role must trust it. The source must provide AWS credentials.
external_id, a JSON session policy, and comma-separated policy_arns. They restrict or qualify the session; they do not create permissions. duration_seconds accepts 900–43200, subject to the remote role limits. Web identity also accepts a session name and duration.
Google Cloud
Google credentials obtain tokens through the Google SDK. Optional common options include space-separatedscopes, quota_project_id, and universe_domain. The consumer may request its own token scope. A scope describes requested access; it does not grant IAM permissions.
Default Google credential chain
Use the Google SDK Application Default Credentials available on the host.Application Default Credentials
This explicit method also uses Application Default Credentials (ADC). Set up the host identity or ADC file before use.Attached compute identity
Use the runtime metadata identity, including an attached compute service account or GKE metadata. Do not supply a credential document for this method.Service account document
Supply a complete service-account JSON document from a secret provider. The service account needs permission on the intended service.Authorized-user document
Supply a complete authorized-user JSON document, including its refresh-token material. It is a different format from a service-account document.External-account federation
Supply a valid external-account document. Its workload identity pool, provider trust, subject-token source, and remote permissions must already be configured.Google workload identity federation
This method also uses an external-account document. It is different from using the attached GKE metadata identity.credential secret or a credential_file, not both. A service-account file variant is:
source. AWS sources also need aws_region. Create the AWS default-chain source first:
source_audience instead of aws_region. A bearer source supplies its saved token. Use a document whose subject-token type and trust match the source. For example, after creating learn_gcp_attached:
Impersonate a service account
Createlearn_gcp_application_default first. That source identity must be allowed to impersonate the target service account. Replace the example principal with your service account.
source to use ADC, or supply a document through credential or credential_file. Named sources may be GCP or bearer credentials. Optional delegates is a comma-separated service-account chain. lifetime_seconds accepts 1–43200; the service may impose tighter limits. metadata_endpoint is only for attached_identity. ID-token support depends on the underlying Google method; authorized-user and external-account documents may require service-account impersonation for that use.
Azure
Identity methods obtain tokens. Shared keys and SAS provide storage-specific access. Optional token settings includescopes or resource. Choose cloud as public, government, or china, or set a custom HTTPS authority_host; do not set both. The target endpoint and token scope must match the cloud.
Default Azure credential chain
Use the production chain on the credential-service host: federated token file, environment client secret, then managed identity. This is separate from developer-tool login.Managed identity
Use a system-assigned identity attached to the runtime. Its metadata service and remote permissions must be available.client_id, object_id, or resource_id. For example:
Azure workload identity
Configure the federated application and token file, such as AKS workload identity. Values can come from options or the standard runtime environment. This example makes them explicit.Application client secret
Register the application and grant it access first. Supply its directory tenant ID, application client ID, and client-secret reference.Application certificate
Register the public certificate with the application. The default format is rawpkcs12. The secret must contain matching certificate and key material. Include the password reference only when the certificate requires it.
certificate_password if needed:
private_key reference. Add private_key_password only for an encrypted private key:
Client assertion
Supply a valid assertion trusted by the target application. Choose an assertion secret or a named source, never both. A saved assertion may expire and need replacement.api://AzureADTokenExchange:
Developer tools
Use the explicit Azure SDK developer-tool chain. Supported tools and a valid login must already be available on the credential-service host. Browser login does not supply this identity.Storage shared key
Use an Azure Blob storage account name and a reference to its account key. This credential is storage-specific, not a bearer token for a catalog API.Storage SAS token
A shared access signature (SAS) limits storage access by permissions, target, and often time. Supply a token that matches the intended storage consumer.se in the token and/or an earlier expires_at_unix_millis option. The earliest applicable expiry wins. Saving a SAS definition does not renew it. Shared keys also accept an optional configured expiry. Remove expired material or rotate its secret source.
Bearer token
A bearer token is sent as the service access token. Its secret must be raw token text, not a JSON wrapper.saved method does not perform an OAuth exchange or refresh that token. Rotate the referenced secret when its token changes.
OAuth 2.0
OAuth client credentials exchange a client ID and secret for an access token. The application, grant, and permissions must already exist. These methods do not implement an interactive browser sign-in.Fixed token endpoint
Chooseclient_credentials when this credential fixes the token endpoint. Replace the client ID, HTTPS endpoint, and scopes with values accepted by the token service.
audience and resource identify the token target where supported. Scopes are space-separated. If a consuming catalog also supplies an endpoint, it must match the fixed endpoint.
Use the consumer token endpoint
Choosesaved for the form option called Use target token endpoint. The consuming catalog supplies the token endpoint. Despite its name, this method stores a client definition, not a ready-made bearer token.
Inspect and use a credential
After creating a chosen example, inspect its definition. These commands return configuration and secret references, not acquired keys or tokens.auth. If its table files need separate AWS access, attach an AWS credential to storage. Create both credentials first. Replace the endpoint, warehouse, and region for your existing service:
retail and orders with actual names. Run each statement separately to inspect its result. Use a known non-empty table: listing metadata alone does not prove access to its files. The catalog connection reference lists the provider-specific settings.
Change one thing
If you created the named AWS profile example, select a second profile that already exists on the host:UNSET OPTIONS ('key') or UNSET SECRETS ('role') to remove fields that no longer apply, while leaving a valid definition. Changing the authentication method may require removing old fields in the same ALTER statement.
Check the result
You have a named credential with the expected provider, authentication method, source, and secret references. A real consumer read proves that the remote service accepts it. Saved configuration, acquired authentication, and authorized data access are separate checks.Clean up
Remove lesson consumers before their credentials. If you created the sample catalog and bearer credential:DROP CREDENTIAL IF EXISTS for the other examples you actually created. Remove dependent credentials before their source credentials: for example, drop learn_aws_assume_role before learn_aws_default_chain. Then remove any lesson-only secrets. Credential deletion does not revoke a cloud key, delete an IAM role, or remove remote permissions. Keep shared resources in place.