Thursday, April 22, 2010

Accessing OpenSSO Identity Services

Step 1: Access WSDL from URL

http://host:port/opensso/identityservices?WSDL

Step 2: Generate Proxy classes from WSDL using Eclipse

Step 3: Access OpenSSO Identity Services


 //Create Operation                 
 IdentityServicesImplProxy identityServicesImplProxy = new IdentityServicesImplProxy();
 identityServicesImplProxy.setEndpoint("http://host:port/opensso/identityservices/IdentityServices");

 IdentityDetails identityDetails = new IdentityDetails();
 String username = "sunmoon3112";
 String emailaddr = "sunmoon3112@mycorp.com";
 String pwd = "Start@12";
           
 //set admin token
 Token result = identityServicesImplProxy.authenticate("amadmin", "P@ssw0rd", "realm=/");
 String admintoken = result.getId();
 Token admin = new Token();
 admin.setId(admintoken);
          
  //set some user attributes           
 Attribute attrs[] = {pwdattr1,emailattr2};
 identityDetails.setName(username);//create user id
 identityDetails.setAttributes(attrs);//set attrs for identity
 identityServicesImplProxy.create(identityDetails, admin);

Step 4: Similarly try accessing all other identity services via generated Proxy

No comments: