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
intro: Use OpenID Connect within your workflows to authenticate with JFrog.
@@ -19,6 +18,8 @@ OpenID Connect (OIDC) allows your {% data variables.product.prodname_actions %}
19
18
20
19
This guide gives an overview of how to configure JFrog to trust {% data variables.product.prodname_dotcom %}'s OIDC as a federated identity, and demonstrates how to use this configuration in a {% data variables.product.prodname_actions %} workflow.
21
20
21
+
> **Note:** If you're using the [`jfrog/setup-jfrog-cli`](https://github.com/jfrog/setup-jfrog-cli) GitHub Action (v4.5.7+), OIDC authentication is fully supported out-of-the-box. You only need to configure your provider name and audience — no manual token exchange is necessary.
22
+
22
23
For an example {% data variables.product.prodname_actions %} workflow, see [Sample {% data variables.product.prodname_actions %} Integration](https://jfrog.com/help/r/jfrog-platform-administration-documentation/sample-github-actions-integration) in the JFrog documentation.
23
24
24
25
For an example {% data variables.product.prodname_actions %} workflow using the JFrog CLI, see [`build-publish.yml`](https://github.com/jfrog/jfrog-github-oidc-example/blob/main/.github/workflows/build-publish.yml) in the `jfrog-github-oidc-example` repository.
@@ -52,59 +53,36 @@ To use OIDC with JFrog, establish a trust relationship between {% data variables
52
53
53
54
## Updating your {% data variables.product.prodname_actions %} workflow
54
55
55
-
Once you establish a trust relationship between {% data variables.product.prodname_actions %} and the JFrog platform, you can update your {% data variables.product.prodname_actions %} workflow file.
56
-
57
-
In your {% data variables.product.prodname_actions %} workflow file, ensure you are using the provider name and audience you configured in the JFrog Platform.
58
-
59
-
The following example uses the placeholder `YOUR_PROVIDER_NAME`.
Alternatively, you can set the audience as an environment variable using the `env` context. For more information about the `env` context, see [AUTOTITLE](/actions/learn-github-actions/contexts#env-context).
88
-
89
-
{% data reusables.actions.oidc-deployment-protection-rules %}
90
-
91
-
```yaml
92
63
jobs:
93
64
build:
94
65
runs-on: ubuntu-latest
95
-
env:
96
-
OIDC_AUDIENCE: 'YOUR_AUDIENCE'
66
+
steps:
67
+
- name: Setup JFrog CLI with OIDC
68
+
uses: jfrog/setup-jfrog-cli@v4
69
+
with:
70
+
oidc-provider-name: 'YOUR_PROVIDER_NAME'
71
+
oidc-audience: 'YOUR_AUDIENCE'
72
+
73
+
- name: Upload artifact
74
+
run: jf rt upload "dist/*.zip" my-repo/
97
75
```
98
76
99
-
Then, in your workflow file, retrieve the value of the variables stored in the `env` context. The following example uses the `env` context to retrieve the OIDC audience.
77
+
## Security Best Practices
100
78
101
-
```yaml
102
-
- name: Get ID Token (using env context)
103
-
uses: {% data reusables.actions.action-github-script %}
104
-
id: idtoken
105
-
with:
106
-
script: |
107
-
const coredemo = require('@actions/core');
108
-
let id_token = await coredemo.getIDToken(process.env.OIDC_AUDIENCE);
109
-
coredemo.setOutput('id_token', id_token);
79
+
- Always use `permissions: id-token: write` in workflows that authenticate with JFrog.
80
+
-Limit trust using specific claims like `repository`, `ref`, or `environment`.
81
+
- Configure identity mappings in JFrog to restrict which workflows are allowed to authenticate.
-[GitHub Docs: About security hardening with OpenID Connect](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
0 commit comments