cas 封装ticket的部分函数
2016-07-29 00:00
183 查看
1.绑定用户信息
2.
authenticationManager这个bean可以配置你的credentials。
If you are using some other kind of credentials than UsernamePasswordCredentials, you will need to replace DefaultCredentialsToPrincipalResolver with a CredentialsToPrincipalResolver that supports the credentials you are using.
protected void bindTicketGrantingTicket(String loginName, String loginPassword, HttpServletRequest request, HttpServletResponse response){ try { UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(); credentials.setUsername(loginName); credentials.setPassword(loginPassword); String ticketGrantingTicket = centralAuthenticationService.createTicketGrantingTicket(credentials); ticketGrantingTicketCookieGenerator.addCookie(request, response, ticketGrantingTicket); } catch (TicketException te) { logger.error("Validate the login name " + loginName + " failure, can't bind the TGT!", te); } catch (Exception e){ logger.error("bindTicketGrantingTicket has exception.", e); } }
2.
authenticationManager这个bean可以配置你的credentials。
If you are using some other kind of credentials than UsernamePasswordCredentials, you will need to replace DefaultCredentialsToPrincipalResolver with a CredentialsToPrincipalResolver that supports the credentials you are using.
相关文章推荐
- cas 封装ticket的部分函数
- JavaScript将继承部分封装成函数extend
- ASP.NET 程序设计中常用到的一些通用函数 自己的封装 可以做成dll来使用。
- 包装外观(Wrapper Facade):用于在类中封装函数的结构型模式
- 《C++捷径教程》读书笔记--Chapter 7--函数,第一部分:基础知识(第二部分)
- 封装回调函数——为对象方法(Object Method,参数中带this指针的函数) 构造 普通函数(参数中无this指针的函数)形式 的入口
- c#部分函数
- 封装回调函数——为对象方法(Object Method,参数中带this指针的函数) 构造 普通函数(参数中无this指针的函数)形式 的入口
- 《C++捷径教程》读书笔记--Chapter 8--函数,第二部分:引用,重载和默认参数
- 部分c#常用函数和方法集
- CBO.vb部分函数分析[DNN 3.2.2]
- 在 C++Builder 工程里使用 Visual C++ DLL——第1部分:C函数
- Window CryptApi 部分函数声明[中文]
- QB部分语句&函数的解释(中文)
- 《C++捷径教程》读书笔记--Chapter 7--函数,第一部分:基础知识(第一部分)
- 收藏——在C#使用SHGetFileInfo获取(管理)文件或者文件夹图标(C#封装Win32函数的一个例子)
- oracle 部分函数
- 动态调用非托管MFC动态链接库中函数的方法封装。
- sap 部分函数
- 把DICOM文件中的图像部分提取到BMP文件的函数