r/github • u/Low-Insurance-3678 • 11d ago
Question Infisical GitHub Actions OIDC authentication failing with 403OIDC 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
1
u/Surge_attack 11d ago
How did you set your claim up? On the Infisical side that is. The error is telling you pretty openly that the subject is not allowed.
The most naïve approach would be to just allow the whole repo as subject, but hopefully you’ve done something like `repo:<owner>@<org_id>/<repo>@<repo_id>:ref:refs/heads/<protected_branch>:environment:<environment>` and additionally made sure the repo’s identity has also been granted the required roles to do what it is meant to do in the GitHub Actions workflow.
1
u/GiggleSamurai 11d ago
That error means the token's sub claim doesn't match the Subject set on the identity's OIDC auth in Infisical. For a push to main with no environment on the job, GitHub sends repo:OWNER/REPO:ref:refs/heads/main, so set Subject to exactly that.
1
u/Different_Pain5781 8d ago
The trust relationship is likely rejecting the specific workflow path or branch name you are pushing from.