mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-07 16:11:30 +00:00
- Do not validate bot domain (#15796)
This commit is contained in:
parent
b79e5c064b
commit
daae3c48e3
@ -218,8 +218,10 @@ public class JwtFilter implements ContainerRequestFilter {
|
|||||||
domain = StringUtils.EMPTY;
|
domain = StringUtils.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate principal domain
|
// validate principal domain, for users
|
||||||
if (enforcePrincipalDomain && !domain.equals(principalDomain)) {
|
boolean isBot =
|
||||||
|
claims.containsKey(BOT_CLAIM) && Boolean.TRUE.equals(claims.get(BOT_CLAIM).asBoolean());
|
||||||
|
if (!isBot && (enforcePrincipalDomain && !domain.equals(principalDomain))) {
|
||||||
throw new AuthenticationException(
|
throw new AuthenticationException(
|
||||||
String.format(
|
String.format(
|
||||||
"Not Authorized! Email does not match the principal domain %s", principalDomain));
|
"Not Authorized! Email does not match the principal domain %s", principalDomain));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user