code:     protected boolean isAuthorizedToSwitchToIdentityZone(String identityZoneId) {
          Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
          boolean hasScope = OAuth2ExpressionUtils.hasAnyScope(authentication, getZoneSwitchingScopes(identityZoneId));
          boolean isUaa = IdentityZoneHolder.isUaa();
          boolean isTokenAuth = (authentication instanceof OAuth2Authentication);
          return isTokenAuth && isUaa && hasScope;
      }
  
  