Development OpenAM Java Client after the Agent installation is complete, you can log in with your own Agentsample app. The main point here is how to get ssotoken after SSO, as well as the relevant Session information. Complete code on Github.
The installation of the Agent is described in the previous article, where you need to configure a policies and then add it to the client Project Web. xml
<filter> <filter-name>Agent</filter-name> <display-name>Agent</display-name> <description>SJS Access Manager Tomcat Policy Agent Filter</description> <filter-class>com.sun.identity.agents.filter.AmAgentFilter</filter-class></filter><filter-mapping> <filter-name>Agent</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>ERROR</dispatcher></filter-mapping>
Get token-related content in your project
SSOTokenManager manager = SSOTokenManager.getInstance();SSOToken token = manager.createSSOToken(request);if (manager.isValidToken(token)) { java.security.Principal principal = token.getPrincipal(); out.println("SSOToken Principal name: " + principal.getName()); out.println("<br />");}
Deploy two identical apps to Tomcat, named Client1,client2, respectively. Access any app and another app is automatically logged in.
Developing OpenAM Java Client