You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow custom claim parser during OIDC login procedure for teams resolution #3908
enhancementNew feature or requestgood first issueGood for newcomershacktoberfestIssues eligible for Hacktoberfest contributionsp2Non-critical bugs, and features that help organizations to identify and reduce risksize/SSmall effort
Right now we can configure ALPINE_OIDC_TEAMS_CLAIM and specify the claim that carries the group/team association of a person that logs in. This currently only works if this claim is a list of strings.
Certain environments do not support this properly, for example if you connect an Azure AD to AWS Cognito and then sign in via OIDC into Dependency Track the original AD groups are mapped to a claim like "custom:groups", however Cognito only supports strings there. That means we end up with ID token claims like this
I would like to be able to make use of our "custom:groups" claim to map it to DT teams at the end.
Proposed Behavior
I can imagine two ways of solving this.
Create a way to allow users to inject custom claim parsers.
If this would be a regular java library one could create an interface and let people register custom parsers for arbitrary fields. I have a hard time imagining how this could be achieved in the current docker based distribution.
Create a special "relaxedGroupClaimParser" flag.
This could be implemented in a way that
if its a list of strings then continue as before
if its a string then trim it, remove [], split it by ",", trim the result list (stuff like this)
We could introduce a strategy flag for this. Such that users can switch between different strategies, and we can add more over time if required, without having to add new boolean flags for all of them.
I do agree that custom parsers that are to be provided via custom JARs are unnecessary and too unwieldy here.
The comma-separated case works on main now (here), but the format from this report still doesn't parse. "[uuid1, uuid2, uuid3]" gets split into [uuid1, uuid2 and uuid3], so the first and last teams never match.
I'd like to pick this up. My plan is to strip a leading [ and trailing ] from string claims before splitting, and add a test for the bracketed form. That keeps the current auto-detection instead of adding a strategy flag. Does that sound OK?
enhancementNew feature or requestgood first issueGood for newcomershacktoberfestIssues eligible for Hacktoberfest contributionsp2Non-critical bugs, and features that help organizations to identify and reduce risksize/SSmall effort
Activity
nscuro commentedon Jul 2, 2024
We could introduce a strategy flag for this. Such that users can switch between different strategies, and we can add more over time if required, without having to add new boolean flags for all of them.
I do agree that custom parsers that are to be provided via custom JARs are unnecessary and too unwieldy here.
nscuro commentedon Jul 2, 2024
Note, the code that maps claims lives here in Alpine: https://github.com/stevespringett/Alpine/blob/05660dc52bbbd926133b84fac8295d386013c551/alpine-server/src/main/java/alpine/server/auth/OidcAuthenticationService.java#L128-L135
Akhil-1527 commentedon Sep 27, 2026
The comma-separated case works on main now (here), but the format from this report still doesn't parse.
"[uuid1, uuid2, uuid3]"gets split into[uuid1,uuid2anduuid3], so the first and last teams never match.I'd like to pick this up. My plan is to strip a leading
[and trailing]from string claims before splitting, and add a test for the bracketed form. That keeps the current auto-detection instead of adding a strategy flag. Does that sound OK?