12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
/* * Program: SSODelegator.java * Purpose: Sample Main program to illustrate SSO Delegator pattern * @author Ray lai (ray.lai@sun.com) * @version 1.0 * Updated: April 20, 2005, 10:45 AM * Copyright: (c) 2005 by Sun Microsystems/Ray Lai under Common Development and Distribution License * Remarks: Full program and documentation will be available under developer.java.net * For simplicity, logger class is removed. * ===================================================================================== * Design summary * */ package com.csp.identity; public class SSODelegator { protected com.csp.identity.SSODelegatorFactoryImpl factory; protected com.csp.identity.SSODelegatorFactoryImpl sample; /** Constructor - Creates a new instance of SSODelegator */ public SSODelegator() { String securityToken = "passMySecurityToken"; try { System.out.println("SSODelegator - this demo will invoke service1 and service2"); System.out.println(); // Constructor for SSODelegatorFactory // you should invoke credential token or alike to pass SSOToken factory = sample.getSSODelegator(securityToken); // Create and close SSOConnection for service 1 factory.createSSOConnection((String)securityToken, "service1"); factory.closeSSOConnection((String)securityToken, "service1"); System.out.println(); // Create and close SSOConnection for service 2 factory.createSSOConnection((String)securityToken, "service2"); factory.closeSSOConnection((String)securityToken, "service2"); } catch (com.csp.identity.SSODelegatorException se) { se.printStackTrace(); } } public static void main(String[] args) { new SSODelegator(); } }