fix current tenant when not an UserPrincipal
Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
@@ -40,6 +40,8 @@ public class SecurityContextTenantAware implements TenantAware {
|
||||
final Object principal = context.getAuthentication().getPrincipal();
|
||||
if (principal instanceof UserPrincipal) {
|
||||
return ((UserPrincipal) principal).getTenant();
|
||||
} else if (context.getAuthentication().getDetails() instanceof TenantAwareAuthenticationDetails) {
|
||||
return ((TenantAwareAuthenticationDetails) context.getAuthentication().getDetails()).getTenant();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user