com.jp.windows.live
Class LogonManager

java.lang.Object
  extended by com.jp.windows.live.LogonManager

public class LogonManager
extends java.lang.Object

This class provides ability to logon to the Windows Live ID service and obtain SecurityToken. Sample usage is as follows:

 try
 {
   SecurityToken securityToken = new LogonManager().logon("live.com", "user", "password");

   System.out.println("Logon succeeded!");
   System.out.println("Passport Token: " + securityToken.getBinarySecurityToken());
   System.out.println("Issue Date:     " + securityToken.getIssueDate());
   System.out.println("Expire Date:    " + securityToken.getExpireDate());
 }
 catch (LogonManagerException lme)
 {
   System.out.println("Logon failed: "+lme.getDetailedMessage());
 }
 catch (Exception ex)
 {
   ex.printStackTrace();
 }
 


Constructor Summary
LogonManager()
          Creates a new instance of the LogonManager and initializes it with default Windows Live ID service url (https://dev.login.live.com/wstlogin.srf)
LogonManager(java.lang.String anURL)
          Creates a new instance of the LogonManager
 
Method Summary
 SecurityToken logon(java.lang.String anEndpointReference, java.lang.String aUserName, java.lang.String aPassword)
          Logons to the Windows Live ID and returns SecurityToken if logon succeeded.
 SecurityToken logon(java.lang.String anEndpointReference, java.lang.String aUserName, java.lang.String aPassword, java.lang.String anApplicationID)
          Logons to the Windows Live ID and returns SecurityToken if logon succeeded.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogonManager

public LogonManager()
Creates a new instance of the LogonManager and initializes it with default Windows Live ID service url (https://dev.login.live.com/wstlogin.srf)


LogonManager

public LogonManager(java.lang.String anURL)
Creates a new instance of the LogonManager

Parameters:
anURL - Windows Live ID service url
Method Detail

logon

public SecurityToken logon(java.lang.String anEndpointReference,
                           java.lang.String aUserName,
                           java.lang.String aPassword)
                    throws LogonManagerException,
                           java.io.IOException,
                           SOAPException
Logons to the Windows Live ID and returns SecurityToken if logon succeeded. Implementation of the method calls the logon(anEndpointReference, aUserName, aPassword, anApplicationID) method and passes empty string as anApplicationID

Parameters:
anEndpointReference - address of the partner site that is eligible to utilize Windows Live ID. It is possible to use live.com address for testing purposes.
aUserName - user name
aPassword - user password
Returns:
SecurityToken if logon succeeded.
Throws:
LogonManagerException - if logon failed
SOAPException - for any SOAP related error
java.io.IOException - if there is a problem in reading SOAP message from the input stream

logon

public SecurityToken logon(java.lang.String anEndpointReference,
                           java.lang.String aUserName,
                           java.lang.String aPassword,
                           java.lang.String anApplicationID)
                    throws LogonManagerException,
                           SOAPException,
                           java.io.IOException
Logons to the Windows Live ID and returns SecurityToken if logon succeeded.

Parameters:
anEndpointReference - address of the partner site that is eligible to utilize Windows Live ID. It is possible to use live.com address for testing purposes.
aUserName - user name
aPassword - user password
anApplicationID - name that identifies particular application. Can be string of any value.
Returns:
SecurityToken if logon succeeded.
Throws:
LogonManagerException - if logon failed
SOAPException - for any SOAP related error
java.io.IOException - if there is a problem in reading SOAP message from the input stream

main

public static void main(java.lang.String[] args)