Skip to content

Commit 0615a66

Browse files
authored
OIDC Authentication Flow Support (jfrog#259)
1 parent f748a05 commit 0615a66

File tree

7 files changed

+576
-281
lines changed

7 files changed

+576
-281
lines changed

.github/workflows/cli-oidc-test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This action is an integration test for OIDC workflow
2+
name: CLI OpenID Connect Test
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
# Triggers the workflow on labeled PRs only.
9+
pull_request_target:
10+
types: [ labeled ]
11+
12+
13+
# Ensures that only the latest commit is running for each PR at a time.
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
permissions:
18+
id-token: write
19+
jobs:
20+
OIDC-Test:
21+
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || github.event_name == 'push'
22+
name: OIDC-Access integration test (${{ matrix.os }})
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os: [ ubuntu, windows, macos ]
27+
runs-on: ${{ matrix.os }}-latest
28+
steps:
29+
- name: Checkout Repository
30+
uses: actions/checkout@v4
31+
with:
32+
ref:
33+
${{ github.event.pull_request.head.ref || github.sha }}
34+
35+
- name: Setup JFrog CLI
36+
id: setup-jfrog-cli
37+
uses: ./
38+
env:
39+
JF_URL: ${{ secrets.JFROG_PLATFORM_URL }}
40+
with:
41+
oidc-provider-name: setup-jfrog-cli-test
42+
43+
- name: Test JFrog CLI
44+
run: |
45+
jf rt ping

.github/workflows/oidc-test.yml renamed to .github/workflows/manual-oidc-test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# This action is an integration test for OIDC workflow
2-
name: OpenID Connect Test
2+
# Which uses the manual approach for backwards compliantly
3+
name: Manual OpenID Exchange Connect Test
34
on:
45
push:
56
branches:
@@ -40,6 +41,8 @@ jobs:
4041
"name": "${{ env.OIDC_PROVIDER_NAME }}",
4142
"issuer_url": "https://token.actions.githubusercontent.com",
4243
"provider_type": "GitHub",
44+
"enable_permissive_configuration": "true",
45+
"token_issuer" : "",
4346
"description": "This is a test configuration created for OIDC-Access integration test" }'
4447
4548
- name: Create OIDC integration Identity Mapping
@@ -67,6 +70,8 @@ jobs:
6770
JF_URL: ${{ secrets.JFROG_PLATFORM_URL }}
6871
with:
6972
oidc-provider-name: ${{ env.OIDC_PROVIDER_NAME }}
73+
# The last version which outputs OIDC params as step outputs
74+
version: '2.74.1'
7075

7176
- name: Test JFrog CLI
7277
run: |

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,21 @@ Example step utilizing OpenID Connect:
118118
oidc-provider-name: setup-jfrog-cli
119119
```
120120

121-
**Notice:** When using OIDC authentication, this action outputs both the OIDC token and the OIDC token username. These can be utilized within the current workflow to log into the JFrog platform through other actions or clients (e.g., for use with `docker login`). The added outputs are `oidc-token` and `oidc-user`, respectively.
121+
**Notice:**
122+
123+
Depending on the version of the CLI and how it is provisioned, this action intelligently chooses the optimal OIDC authentication flow:
124+
125+
✅ Native OIDC (Recommended Path)
126+
127+
If you are using JFrog CLI version 2.75.0 or above and not downloading the CLI from Artifactory
128+
(via the download-repository input),
129+
the setup action will use the CLI's native `--oidc-token-id` authentication mechanism.
130+
131+
🔁 Manual Fallback (for legacy or remote setups)
132+
133+
If the CLI version is below 2.75.0, or if you're downloading the CLI from Artifactory using download-repository, the action will automatically fall back to a manual OIDC token exchange using the JFrog Platform REST API.
134+
135+
📝 This fallback logic is kept for backward compatibility but is planned for deprecation to avoid maintaining duplicate authentication flows.
122136

123137
### Handling Self-Signed Certificates
124138

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: "JFrog"
44
inputs:
55
version:
66
description: "JFrog CLI Version"
7-
default: "2.73.0"
7+
default: "2.75.0"
88
required: false
99
download-repository:
1010
description: "Remote repository in Artifactory pointing to 'https://releases.jfrog.io/artifactory/jfrog-cli'. Use this parameter in case you don't have an Internet access."

0 commit comments

Comments
 (0)