Skip to content

Commit

Permalink
Added check to ensure 'sub' is present in claim before parsing and us…
Browse files Browse the repository at this point in the history
…e token subjact if sub is not present in claims

Signed-off-by: wassafshahzad <[email protected]>
  • Loading branch information
wassafshahzad committed Nov 18, 2024
1 parent 262c326 commit 628aae3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions filters/auth/oidc_introspection.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,13 @@ func (filter *oidcIntrospectionFilter) Request(ctx filters.FilterContext) {
return
}

sub := token.Claims["sub"].(string)
authorized(ctx, sub)
sub, ok := token.Claims["sub"]
if ok {
authorized(ctx, sub.(string))
} else {
sub := token.Subject
authorized(ctx, sub)
}
}

func (filter *oidcIntrospectionFilter) Response(filters.FilterContext) {}
Expand Down

0 comments on commit 628aae3

Please sign in to comment.