File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -185,13 +185,17 @@ func (am *mgr) isIssuerAllowed(issuer string) bool {
185185}
186186
187187func (am * mgr ) doUserMapping (tkn * oidc.IDToken , claims jwt.MapClaims ) (string , error ) {
188+ var sub = tkn .Subject
189+ if am .c .IDClaim != "sub" && claims [am .c .IDClaim ] != nil {
190+ sub , _ = claims [am .c .IDClaim ].(string )
191+ }
188192 if len (am .oidcUsersMapping ) == 0 {
189- return tkn . Subject , nil
193+ return sub , nil
190194 }
191195 // we need the custom claims for the mapping
192196 if claims [am .c .GroupClaim ] == nil {
193197 // we are required to perform a user mapping but the group claim is not available
194- return tkn . Subject , nil
198+ return sub , nil
195199 }
196200
197201 mappings := make ([]string , 0 , len (am .oidcUsersMapping ))
You can’t perform that action at this time.
0 commit comments