【发布时间】:2016-09-05 15:44:25
【问题描述】:
我们正在为客户使用 UAA 的多租户功能。因此,每个人都有自己的身份区域。我们还希望有一个与默认 UAA 身份区域分开的管理员身份区域。但是,似乎只有默认 UAA 身份区域中的用户才能切换身份区域。
来自IdentiyZoneSwitchingFilter:
if (IdentityZoneHolder.isUaa() && oAuth2Authentication != null && !oAuth2Authentication.getOAuth2Request().getScope().isEmpty()) {
SecurityContextHolder.getContext().setAuthentication(oAuth2Authentication);
} else {
response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not authorized to switch to IdentityZone with id "+identityZoneId);
return;
}
显然,IdentityZoneHolder.isUaa() 对于除 UAA 身份区域之外的任何内容都是错误的。
过去,我们对 UAA 进行了重大修改以支持我们的功能,包括安装我们自己的 IdentityZoneSwitchingFilter。我们最近升级到了 3.3.0,并试图提取我们所有的代码,以便在我们的东西和 UAA 之间进行清晰的分离。
我们希望 UAA 保持不变,但看起来我们仍然需要配置自己的 IdentityZoneSwitchingFilter。它是否正确?是否有其他方法可以在不修改 UAA 的情况下完成此操作?
【问题讨论】:
标签: cloud-foundry cloudfoundry-uaa