You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/modules/permissions-authentication/pages/openid-connect-tokens.adoc
+21-18Lines changed: 21 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,21 +18,12 @@ Some advantages to using OIDC over using static credentials:
18
18
19
19
CircleCI OpenID Connect ID tokens are available in the following environment variables:
20
20
21
-
[.table-scroll]
22
-
--
23
-
.Explaining the available OIDC tokens available in environment variables
24
-
[cols="1,2", options="header"]
25
-
|===
26
-
| Environment variable
27
-
| Description
21
+
* `$CIRCLE_OIDC_TOKEN`
28
22
29
-
| `$CIRCLE_OIDC_TOKEN`
30
-
| The default OIDC token. See <<format-of-the-openid-connect-id-token>> for full details.
23
+
* `$CIRCLE_OIDC_TOKEN_V2` - This token includes a different `sub` claim format to include a reference to the source of the change that triggered the job.
24
+
25
+
See <<format-of-the-openid-connect-id-token>> for full details on the Claims used in each token.
31
26
32
-
| `$CIRCLE_OIDC_TOKEN_V2`
33
-
| Includes a different format for the `sub` claim to include a reference to the repository and branch. See <<format-of-the-openid-connect-id-token>> for full details.
34
-
|===
35
-
--
36
27
37
28
CAUTION: **What about forks?** OIDC tokens will only be generated for forked builds if the **Pass secrets to builds from forked pull requests** setting is enabled. Find this option at **Project settings** > **Advanced**. See <<oidc-in-open-source-projects>>.
38
29
@@ -514,15 +505,27 @@ CircleCI's OIDC tokens contain the following standard https://openid.net/specs/o
514
505
| `sub`
515
506
a| The subject. This identifies who is running the CircleCI job and where. `$CIRCLE_OIDC_TOKEN_V2` also includes information about the source of change.
516
507
517
-
For `$CIRCLE_OIDC_TOKEN` its value is: `"org/<organization_id>/project/<project_id>/user/<user_id>"`, a string, where `organization_id`, `project_id`, and `user_id` are UUIDs that identify the CircleCI organization, project, and user, respectively. The user is the CircleCI user that caused this job to run.
508
+
---
518
509
519
-
For `$CIRCLE_OIDC_TOKEN_V2` its value depends on the trigger type:
510
+
For `$CIRCLE_OIDC_TOKEN` its value is:
520
511
521
-
* If the trigger is an xref:orchestrate:triggers-overview.adoc#trigger-a-pipeline-from-a-custom-webhook[Custom Webhook] then:
522
512
`"org/<organization_id>/project/<project_id>/user/<user_id>"`, a string, where `organization_id`, `project_id`, and `user_id` are UUIDs that identify the CircleCI organization, project, and user, respectively. The user is the CircleCI user that caused this job to run.
523
513
524
-
* Otherwise it will be:
525
-
`"org/<organization_id>/project/<project_id>/user/<user_id>/vcs-origin/<vcs_origin>/vcs-ref/<vcs_ref>"`, a string, where `organization_id`, `project_id`, and `user_id` are UUIDs that identify the CircleCI organization, project, and user, respectively. The user is the CircleCI user that caused this job to run. `vcs_origin` and `vcs_ref` are strings that identify the repository URL and reference to the change that caused the job to run.
514
+
---
515
+
516
+
For `$CIRCLE_OIDC_TOKEN_V2` its value depends on the trigger type:
517
+
518
+
*If the trigger is a* xref:orchestrate:triggers-overview.adoc#trigger-a-pipeline-from-a-custom-webhook[Custom Webhook]:
A string in which `organization_id`, `project_id`, and `user_id` are UUIDs that identify the CircleCI organization, project, and user, respectively. The user is the CircleCI user that caused this job to run.
A string in which `organization_id`, `project_id`, and `user_id` are UUIDs that identify the CircleCI organization, project, and user, respectively. The user is the CircleCI user that caused this job to run. `vcs_origin` and `vcs_ref` are strings that identify the repository URL and reference to the change that caused the job to run.
526
529
527
530
| `aud`
528
531
| The audience. By default, this is `ORGANIZATION_ID`, a string containing a UUID that identifies the job's project's organization. To customize the audience you can generate an OIDC token with a custom audience. See xref:oidc-tokens-with-custom-claims.adoc[OIDC Tokens With Custom Claims] for more information.
0 commit comments