ARCHIVEThis forum closed in November 2026 and is read-only. Ask new questions in GitHub Discussions.Restart this discussion on GitHub

“contains” operator for Claim Criterion

What happened?

According to the Pomerium Policy language, the “contains” operator should work with the claims string matcher

ingress.pomerium.io/policy: |
  allow:
    and:
      - claim/custom:groups: "[Devleads, Developer]"

{"level":"info","service":"authorize","method":"GET","path":"/favicon.ico","host":"test-app.pomerium.dev.com","query":"","allow":true,"allow-why-true":["claim-ok"],"deny":false,"deny-why-false":["valid-client-certificate-or-none-required"],"time":"2025-07-28T09:25:31Z","message":"authorize check"}

What did you expect to happen?

ingress.pomerium.io/policy: |
  allow:
    and:
      - claim/custom:groups:
            contains: "Developer"

{"level":"info","service":"authorize","method":"GET","path":"/","host":"test-app.pomerium.dev.com","query":"","allow":false,"allow-why-false":["claim-unauthorized","non-pomerium-route"],"deny":false,"deny-why-false":["valid-client-certificate-or-none-required"],"time":"2025-07-28T09:25:54Z","message":"authorize check"}

What’s your environment like?

  • Pomerium version (retrieve with pomerium --version): v0.22.1
  • Server Operating System/Architecture/Cloud: EKS

What’s your config.yaml?

autocert: false
dns_lookup_family: V4_ONLY
address: :443
grpc_address: :443
certificate_authority_file: "/pomerium/ca/ca.crt"
certificates:
authenticate_service_url: https://authenticate.pomerium.dev.com
authorize_service_url: https://pomerium-authorize.pomerium.svc.cluster.local
databroker_service_url: https://pomerium-databroker.pomerium.svc.cluster.local
idp_provider: oidc
idp_scopes: openid profile email
idp_provider_url: https://cognito-idp.eu-west-1.amazonaws.com/eu-west-1_AYuZSIE6
jwt_claims_headers:
  - groups
idp_client_id: idp_client_id
idp_client_secret: idp_client_secret
databroker_storage_tls_skip_verify: false

Additional context

The issue is that Cognito passes the groups as strings instead of lists

"[Devleads, Developer]"

Are there any other operators that can check for the substring in claim/custom:groups?

anon77921604Sep 8, 2025

Hi Vijay,

Thank you for using Pomerium!

In the case of claim matching, the claim criterion must match the supplied value exactly.

e.g.

allow:
  or:
    - "claim/cognito:groups": Devleads
    - "claim/cognito:groups": Developer

Is there a reason you are forming a custom claim as a string rather than using Cognito’s built-in cognito:groups claim? The built-in claim should be a compatible list.

The reason we have the custom:claims is because they are linked to Okta groups. Cognito uses Okta as an external IdP.

I’ll check if it’s possible to map Okta with cognito:groups or find a workaround.

Right now, we’re unable to directly connect Okta with Pomerium due to the plan we’re on with Okta.

Thank you for clarifying. I appreciate it!