Skip to main content
TutorialApplies to: Unified engine deployments
Use SQL to define how Laminar authenticates to a service. This page covers all five credential providers and all 31 supported authentication methods. Choose the method that matches your environment; you do not need to create every example. A credential stores an authentication definition and secret references. It does not grant remote permissions. Acquired keys and tokens are separate from the saved definition.

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 unused learn_ 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 except saved 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 contain aws_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.
Alternatively, supply separate references. Include session_token for temporary keys; omit it for long-lived keys. Do not combine these fields with a bundle.
An optional 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 optional profile selects a host profile.

Environment credentials

Set AWS credential environment variables on the credential-service host before using this method.

Named profile

Install the analytics 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.
For explicit IRSA, provide both 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, a subject_token secret, or a named token-producing credential.
The secret-reference variant uses the same role, without token_file:
For a named Google source, first create 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 create learn_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.
Optional options include 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-separated scopes, 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.
For any of these four document methods, choose either a credential secret or a credential_file, not both. A service-account file variant is:
For federation from another named credential, keep the external-account document and add source. AWS sources also need aws_region. Create the AWS default-chain source first:
A Google or Azure token source uses 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

Create learn_gcp_application_default first. That source identity must be allowed to impersonate the target service account. Replace the example principal with your service account.
Alternatively, omit 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 include scopes 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.
For a user-assigned identity, choose exactly one of 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 raw pkcs12. The secret must contain matching certificate and key material. Include the password reference only when the certificate requires it.
For base64-encoded PKCS#12, use this variant. Add certificate_password if needed:
PEM certificates require a separate 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.
A named source can be an Azure, Google, or bearer credential. First create the source and configure the application trust. This Google example requests an ID token for 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.
SAS expiry is read from 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.
The 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

Choose client_credentials when this credential fixes the token endpoint. Replace the client ID, HTTPS endpoint, and scopes with values accepted by the token service.
Optional 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

Choose saved 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.
The consumer must supply an appropriate endpoint for the token exchange. Obtained OAuth tokens can be renewed through the provider while the client secret and permissions remain valid. This is different from replacing a saved 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.
Use the name you actually created. A successful CREATE or DESCRIBE is not a remote authentication test. For a catalog that accepts bearer authentication, attach the bearer credential to 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:
This is an example for that specific catalog and S3 storage combination. For OAuth or signed requests, use the corresponding catalog method and provider options. Storage credentials and metadata credentials can be different identities. A saved credential does not add support for a service connector that Laminar does not implement. Use an existing namespace and table in that catalog to check real access:
Replace 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:
Expect the definition’s profile and revision to change. Rerun a consumer query to prove that the new profile has the intended access. Do not change a shared credential for this exercise. You can also replace one secret reference:
This example needs that actual provider alias and remote token. ALTER preserves the name and provider. It keeps options and secret roles not mentioned in the command. Use 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:
Use 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.

Continue

Connect your data uses credentials to open catalogs. Secrets explains value storage, external references, versions, and rotation. Provider guides cover AWS, Google Cloud, Azure, and tokens and OAuth.
Last modified on November 4, 2026