Skip to content

Commit

Permalink
[fix] fix the problem of can not require the api of kie when open rbac (
Browse files Browse the repository at this point in the history
  • Loading branch information
tornado-ssy authored Jul 16, 2024
1 parent eaf52a2 commit dc6d3d1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions server/plugin/auth/buildin/buildin.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,20 @@ func (ba *TokenAuthenticator) VerifyToken(req *http.Request) (interface{}, error
return nil, rbacmodel.NewError(rbacmodel.ErrNoAuthHeader, "")
}
claims, ok := tokenCache.Get(v)
s := strings.Split(v, " ")
if len(s) != 2 {
return nil, rbacmodel.ErrInvalidHeader
}
to := s[1]
if ok {
token.WithRequest(req, to)
switch claimsVal := claims.(type) {
case error:
return nil, claimsVal
default:
return claimsVal, nil
}
}
s := strings.Split(v, " ")
if len(s) != 2 {
return nil, rbacmodel.ErrInvalidHeader
}
to := s[1]

claims, err := authr.Authenticate(req.Context(), to)
if err != nil {
Expand Down

0 comments on commit dc6d3d1

Please sign in to comment.