Fix #493: Fixed pipeline with auth-type auth0 (#495)

* Fixed pipeline with auth-type okta and auth0

* addressing pyline findings

* addressing comments

* added fix for auth-type auth0

Co-authored-by: parthp2107 <parth@getcollate.io>
This commit is contained in:
parthp2107 2021-09-15 22:02:29 +05:30 committed by GitHub
parent 5c3fd6cad8
commit dbd4be5931
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,7 +88,7 @@ public class JwtFilter implements ContainerRequestFilter {
throw new AuthenticationException("Invalid token");
}
String authorizedEmail;
if (jwt.getClaim("email") != null) {
if (jwt.getClaims().get("email") != null) {
authorizedEmail = jwt.getClaim("email").as(TextNode.class).asText();
} else if (jwt.getClaim("sub") != null){
authorizedEmail = jwt.getClaim("sub").as(TextNode.class).asText();
@ -118,5 +118,4 @@ public class JwtFilter implements ContainerRequestFilter {
}
return source;
}
}