fix current tenant when not an UserPrincipal

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
Michael Hirsch
2016-10-31 15:44:30 +01:00
parent 22272ba3c1
commit 3b869e215e

View File

@@ -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;