r/webdev • • 24d ago

Infisical GitHub Actions OIDC authentication failing with 403 OIDC subject not allowed

hi, I'm having trouble getting Infisical OIDC authentication working in my GitHub Actions CI pipeline.
Every time my workflow reaches the Infisical secrets action, it fails with:

Run Infisical/secrets-action@v1.0.16

Error: Access denied: OIDC subject not allowed.

{

"statusCode": 403,

"message": "Access denied: OIDC subject not allowed.",

"error": "ForbiddenError"

}

Request failed with status code 403

here’s the GitHub Actions workflow:

name: ci
on:
push:
branches: [main]

permissions:
id-token: write
contents: read

jobs:
build-and-deploy:
runs-on: ubuntu-26.04

steps:
- name: Checkout repository
uses: actions/checkout@v7

- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: 24
cache: npm

- name: Install dependencies
run: npm ci

- name: Fetch secrets from Infisical
uses: Infisical/secrets-action@v1.0.16
with:
method: oidc
identity-id: MY_IDENTITY_ID
project-slug: my-slug
env-slug: prod

- name: Run Jest tests
run: npm run test:ci

- name: Build Vinext app
run: npm run build:vinext

- name: Deploy to Cloudflare
run: npm run deploy:vinext -- --skip-build

Id appreciate any help

0 Upvotes

8 comments sorted by

2

u/quantum1eeps 24d ago

Are you using the immutable format?

1

u/Low-Insurance-3678 24d ago

i think ur talking about the claims we set on infisical I haven’t understood what are they i haven’t set anything regarding claims

2

u/Character-Flight3311 24d ago

That 403 is Infisical saying the token's subject doesn't match what you configured on the machine identity. In the OIDC auth settings, set Subject to exactly what GitHub puts in sub for that workflow, usually something like repo:YOUR_ORG/YOUR_REPO:ref:refs/heads/main, and keep Issuer as https://token.actions.githubusercontent.com. Repos created or renamed after mid-July 2026 often use the newer immutable form with @ numeric IDs in the subject, so if the plain name still fails, check the repo's OIDC subject customization and copy that prefix into Infisical. Also make sure Audiences matches your org URL and the job has permissions: id-token: write.

1

u/Low-Insurance-3678 23d ago

hi man yep ur right the old format that has / in it didn’t work had to use the one that has @ in it

thank you so muuch

2

u/ccuadros_dev 21d ago

A 403 “subject not allowed” almost always means the subject you configured on the provider doesn’t match the token’s sub claim. For GitHub OIDC the sub looks like repo:ORG/REPO:ref:refs/heads/main (or :environment:NAME). If your allowed-subject condition is scoped to a branch/environment that doesn’t match the run, it rejects it. Print the OIDC claims in a debug step, read the actual sub, and make the provider condition match exactly — also double-check the aud.

1

u/Low-Insurance-3678 21d ago

hi man I appreciate that subject format is not applied for repos that are created after july 15 2026 so that issue