- Newest
- Most votes
- Most comments
Thank you for your detailed feedback regarding OIDC federation with self-hosted GitLab instances. I appreciate your enthusiasm about the recent enhancements to AWS STS.
To clarify the current capabilities: AWS STS does support OIDC federation with self-hosted identity providers, including self-hosted GitLab instances. When you create an OIDC identity provider in IAM, you can specify the provider URL for your self-hosted instance, which allows federated access through the AssumeRoleWithWebIdentity API.
The recent announcement about validating select identity provider-specific claims applies to certain pre-configured claims from specific providers. However, AWS already provides flexibility for working with custom claims from OIDC providers:
For Custom Claims: You can add your own custom claims to tokens by passing them as request tags when working with AWS STS. Custom claims are nested under the https://sts.amazonaws.com/ namespace and can be referenced in IAM role trust policies and resource control policies as condition keys.
For Self-Hosted GitLab: When integrating with self-hosted GitLab instances, you would configure the OIDC identity provider in IAM with your GitLab instance URL. The standard OIDC claims (such as sub, aud, iss) are available for use in trust policy conditions, and you can work with additional claims that your GitLab instance includes in its tokens.
The key is ensuring that your IAM role trust policies are configured to properly validate the claims coming from your self-hosted provider, using condition keys that match the claims structure your provider sends.
If you're looking for specific pre-validated custom claims similar to those announced for the SaaS providers, I'd recommend submitting this as formal feedback through the AWS Support Center or your AWS account team, as they can route feature requests to the appropriate service teams for consideration.
Sources
AWS STS now supports validation of select identity provider specific claims from Google, GitHub, CircleCI and OCI - AWS
Understanding token claims - AWS Identity and Access Management
Relevant content
- AWS OFFICIALUpdated a year ago

Thank you for the response. I am aware of the custom claims that STS will add. And that is great but it was not what I was going for.
I have a self hosted GitLab instance and each job gets a OIDC JWT from GitLab that can be used to authenticate against AWS by using the IAM Identity Provider and setting up GitLab OIDC. The documentation of GitLab shows how you can use their custom claims (https://docs.gitlab.com/ci/secrets/id_token_authentication/) by specifying the conditions in the trust relationship. https://docs.gitlab.com/ci/cloud_services/aws/.
But these custom claims are only supported by AWS IAM if they are coming from gitlab.com and not when they are from a custom OIDC endpoint like my self hosted instance. That is where adding pre-vetted custom claims to the IAM Identity Provider OIDC configuration could be enormously valuable. I understand they might not want to ingest all claims but maybe this is a step in the right direction to support that.