Skip to content

feat[@ai-codex]: Add validation of required audience for OIDC tokens - #5029

Draft
pavel-jares-bcm wants to merge 3 commits into
v3.x.xfrom
reboot/ZOWESERVER_ZOWE_API-LAYER_V3-X_X-001
Draft

pavel-jares-bcm wants to merge 3 commits into
v3.x.xfrom
reboot/ZOWESERVER_ZOWE_API-LAYER_V3-X_X-001

Conversation

@pavel-jares-bcm

@pavel-jares-bcm pavel-jares-bcm commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR adds validation of a required audience in OIDC token.

API Mediation Layer supports optional validation of the aud (audience) claim in OIDC tokens. Use this setting to require that tokens identify the intended recipient.

Add aud to your existing OIDC configuration in zowe.yaml (available for components apiml, gateway and zaas):

  components: 
    gateway: 
      apiml: 
        security: 
          oidc: 
            enabled: true 
            aud: "api://zowe" 

Replace api://zowe with the audience your identity provider includes in tokens intended for API Mediation Layer.

When configured:

  • A string aud claim must exactly match the configured value.
  • An array aud claim must contain the configured value.
  • Matching is case-sensitive. Tokens with a missing or mismatched audience are rejected.
  • Audience validation applies to both local JWKS validation and external UserInfo validation, including fallback to UserInfo. A successful UserInfo response does not bypass the audience check.

For this example, both "aud": "api://zowe" and "aud": ["other-api", "api://zowe"] satisfy the audience requirement.

Audience validation is disabled by default. Omit aud or set it to "" to leave it disabled. Other token-validation requirements still apply.

Linked to # (issue)
Part of the # (epic)

ZOWESERVER_ZOWE_API-LAYER_V3-X_X-001

Type of change

Please delete options that are not relevant.

  • feat: New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • PR title conforms to commit message guideline ## Commit Message Structure Guideline
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The java tests in the area I was working on leverage @nested annotations
  • Any dependent changes have been merged and published in downstream modules

For more details about how should the code look like read the Contributing guideline

@github-actions github-actions Bot added the Sensitive Sensitive change that requires peer review label Oct 16, 2026
@richard-salac
richard-salac force-pushed the reboot/ZOWESERVER_ZOWE_API-LAYER_V3-X_X-001 branch 4 times, most recently from 6d1a64d to eeb715d Compare October 20, 2026 12:08
@richard-salac
richard-salac marked this pull request as ready for review October 20, 2026 12:41
@richard-salac
richard-salac marked this pull request as draft October 20, 2026 12:41
@richard-salac richard-salac changed the title feat: Add validation of required audience for OIDC tokens feat[@ai-codex]: Add validation of required audience for OIDC tokens Oct 20, 2026
pavel-jares-bcm and others added 3 commits October 20, 2026 17:12
Signed-off-by: Pavel Jareš <Pavel.Jares@broadcom.com>
Signed-off-by: Richard Salac <richard.salac@broadcom.com>
Signed-off-by: Richard Salac <richard.salac@broadcom.com>
@richard-salac
richard-salac force-pushed the reboot/ZOWESERVER_ZOWE_API-LAYER_V3-X_X-001 branch from eeb715d to f1741ff Compare October 20, 2026 15:12
@sonarqubecloud

Copy link
Copy Markdown

@richard-salac richard-salac added this to the 4.0 milestone Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Sensitive Sensitive change that requires peer review size/XL V4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants