ARTIFACTORY: How to Configure Dynamic Group Mapping in Artifactory OIDC Integration Using GitHub Custom Properties]

Products
Frog_Artifactory
Content Type
User_Guide
AuthorFullName__c
Shisiya Sebastian
articleNumber
000007145
FirstPublishedDate
2026-08-30T07:11:27Z
lastModifiedDate
2026-08-30

ARTIFACTORY: How to Configure Dynamic Group Mapping in Artifactory OIDC Integration Using GitHub Custom Properties]

Introduction
This KB article explains how to automatically assign JFrog Artifactory groups permissions based on custom repository properties in GitHub. By sending these properties through GitHub OIDC during authentication, Artifactory can dynamically grant the right group permissions to temporary access tokens.


Implementation
Step 1: Create the Custom Property in GitHub
  1. In GitHub, navigate to your Organization Settings.
  2. In the left sidebar, go to Repository → Custom properties.
  3. Click Create property.
  4. Set the property name (e.g., my_property).
  5. Enable the option "Allow repository actors to set this property".
  6. Save the property configuration.
Note:

Custom property names must contain only alphanumeric characters (a–z, A–Z, 0–9) and underscores (_). Please avoid using hyphens (-), as Artifactory may not correctly parse hyphens in Group Mappings.


Step 2: Include the Custom Property in the GitHub OIDC Claim
  1. In your GitHub Organization, go to Settings → Actions → General.
  2. Scroll to the OpenID Connect (OIDC) section.
  3. Add the newly created custom property (my_property) to the list of included OIDC claims.
Note:

GitHub automatically prefixes repository custom properties with repo_property_ in the generated JWT token claims.


Step 3: Assign the Property Value at the Repository Level
  1. Navigate to the target GitHub Repository under your organization.
  2. Go to Settings → Custom properties (or General → Properties).
  3. Set the value for my_property (e.g., test-environment).
  4. Save your changes.


Step 4: Configure the Identity Mapping in JFrog Artifactory
  1. Log in to Artifactory as an Administrator.
  2. Go to Administration → Authentication → OIDC Integration.
  3. Select your GitHub OIDC Provider (or create a new one).
  4. Edit or create a new Identity Mapping:
    • Claims: Define your claims (e.g., {"repository": "my-org/my-repo*"}).
    • Token Scope: Select Groups Mapping.
    • Group Mapping Pattern / Value: Set the dynamic mapping expression to reference the GitHub claim using double curly braces:
{{repo_property_my_property}}
  1. Save the Identity Mapping.


Verification & Validation
1. Verify the GitHub OIDC JWT Claim
Add the following step to your GitHub Actions workflow to print and inspect the decoded JWT token:
  steps:
            - name: Get id token
              run: |
                ID_TOKEN=$(curl -sLS -H "User-Agent: actions/oidc-client"
                -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
                "${ACTIONS_ID_TOKEN_REQUEST_URL}" | jq .value | tr -d '"')
                echo "$ID_TOKEN" | cut -d '.' -f 2 | base64 -d 2>/dev/null | jq .
Decoding the returned GitHub ID token (JWT) should reveal the custom property claim formatted as:
JSON
{
  "nbf": 1783667131,
  "ref": "refs/heads/main",
  "ref_protected": "false",
  "ref_type": "branch",
  "repo_property_my_property": "test-environment",
  "repository": "my-org/my-repo"
}


2. Verify the Artifactory Access Token Scope
Inspect the access token generated by Artifactory during the OIDC exchange. You can call the Artifactory Access API inside your workflow to inspect the scope assigned to the generated token:
           - name: GET Token
              run: |
                    curl -H "Authorization: Bearer $ACCESS_TOKEN" -X GET
                    https://JFROG_URL/access/api/v1/tokens/me
You will observe that the dynamic group mapping successfully converted the GitHub claim into an applied group scope:
JSON
{
  "token_id": "12adc0dd-5cc0-4906-a129-fc7c5b62d429",
  "subject": "github-oidc-provider/my-org",
  "expiry": 1783883432,
  "issued_at": 1783667432,
  "scope": "applied-permissions/groups:\"test-environment\"",
  "last_used": 1783667433
}


References