我有一个分类的Spring应用程序(带有过滤器,运行正常)。
这个应用程序必须通过REST查询几个外部服务(Bonita、W4等)。这些其他服务也被分类。
好的。
现在,我需要从spring应用程序中恢复CAS票证,以便为这些其他服务生成代理票证,但我不知道如何才能获得票证。我尝试使用以下URL请求这些服务的票证:
https://[cas-service]/login?service=[service]&gateway=true这个命令返回一个票证(通过重定向),但是用于Spring应用程序的CAS过滤器拦截了这个重定向,并且我无法获得返回的参数。
http://[service-url]?ticket=ST-.... 重定向到
http://[service-url]如何检索工单以验证当前用户是否可以使用其他服务?
谢谢你!!
PD:对不起,我的英语水平有限……:)
发布于 2013-03-21 16:22:32
SecurityContext ctx=SecurityContextHolder.getContext();
CasAuthenticationToken casToken=(CasAuthenticationToken) ctx.getAuthentication();
Assertion assertion=casToken.getAssertion();
user_fullName=(String) assertion.getAttributes().get("FullName");从安全上下文中,您可以获取经过身份验证的CAS令牌对象。它具有SAML响应。CAS令牌对象包含SAML响应的详细信息。您可以查询CAS token对象来获取ASSERTION,并在您的App中使用。
https://stackoverflow.com/questions/14870287
复制相似问题