> ## Documentation Index
> Fetch the complete documentation index at: https://docs.niteshift.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# OIDC tokens

> Authenticate tasks to Vault, Snowflake, and other services that trust short-lived Niteshift-issued OIDC tokens.

Many services can trust short-lived, Niteshift-issued OIDC tokens. Examples:

* [HashiCorp Vault](https://developer.hashicorp.com/vault/docs/auth/jwt#jwt-authentication)
* [Confluent Cloud](https://docs.confluent.io/cloud/current/security/authenticate/workload-identities/identity-providers/oauth/overview.html)
* [Snowflake](https://docs.snowflake.com/en/user-guide/workload-identity-federation)

Tailscale also accepts these tokens; use the native [Tailscale integration](https://docs.niteshift.dev/integrations/tailscale.md) instead of
minting them yourself.

The token issuer is `https://identity.niteshift.dev`
([discovery document](https://identity.niteshift.dev/.well-known/openid-configuration)).

| Claim | Meaning |
| - | - |
| `sub` | Subject in the form `org:<org_id>:environment:<environment_id>`. It is shared by tasks in the same organization and environment. |
| `environment_id` | ID of the environment selected for the task. |
| `user_id` | User associated with the task. System-issued tokens for cache builds omit this claim. |
| `org_id` | ID of the organization that owns the environment. |

Each token is minted for an audience, which is the value the target service tells you to expect. To
see the exact claim values for your environment, ask the agent or run this in the task terminal:

```bash theme={"dark"}
ns oidc-token --inspect --audience '<audience>'
```

To mint a token, ask the agent or run:

```bash theme={"dark"}
ns oidc-token --audience '<audience>'
```

Minting a token does not grant access to another service by itself; configure access for the identity on the service side.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.