예제 #1
0
 /**
  * Initialize the WindowsLiveLogin module from a settings file. 
  *
  *  'settingsFile' specifies the location of the XML settings file
  *  that contains the application ID, secret key, and security
  *  algorithm. The file is of the following format:
  *
  *  <windowslivelogin>
  *    <appid>APPID</appid>
  *    <secret>SECRET</secret>
  *    <securityalgorithm>wsignin1.0</securityalgorithm>
  *  </windowslivelogin>
  *
  *  In a Delegated Authentication scenario, you may also specify
  *  'returnurl' and 'policyurl' in the settings file, as shown in the
  *  Delegated Authentication samples.
  *
  *  We recommend that you store the WindowsLiveLogin settings file
  *  in an area on your server that cannot be accessed through the 
  *  Internet. This file contains important confidential information.
  */
 public static function initFromXml($settingsFile)
 {
     $o = new WindowsLiveLogin();
     $settings = $o->parseSettings($settingsFile);
     if (@$settings['debug'] == 'true') {
         $o->setDebug(true);
     } else {
         $o->setDebug(false);
     }
     if (@$settings['force_delauth_nonprovisioned'] == 'true') {
         $o->setForceDelAuthNonProvisioned(true);
     } else {
         $o->setForceDelAuthNonProvisioned(false);
     }
     $o->setAppId(@$settings['appid']);
     $o->setSecret(@$settings['secret']);
     $o->setOldSecret(@$settings['oldsecret']);
     $o->setOldSecretExpiry(@$settings['oldsecretexpiry']);
     $o->setSecurityAlgorithm(@$settings['securityalgorithm']);
     $o->setPolicyUrl(@$settings['policyurl']);
     $o->setReturnUrl(@$settings['returnurl']);
     $o->setBaseUrl(@$settings['baseurl']);
     $o->setSecureUrl(@$settings['secureurl']);
     $o->setConsentBaseUrl(@$settings['consenturl']);
     return $o;
 }