Table of Contents

<#windowslive_oauth2callback>

This function check the windows live OAuth 2.0 authentification (http://msdn.microsoft.com/en-us/library/live/hh243649.aspx), If success login the user or register him. Typically, the website open a popup to the url https://login.live.com/oauth20_authorize.srf with a redirect_uri to a link that contain this function. The function itself will be responsible to login or create (and login) the user and the template of this function will be responsible to close the popup and reload the parent document

Parameters

Name Mandatory Default Description
template No Used to build the content of the result
client_id Yes Your app's client ID (https://manage.dev.live.com/Applications/Index)
client_secret Yes Your app's client secret
redirect_uri No /authentication/facebook_oauth2callback/ The URI registered with the application

Example

<#{windowslive_oauth2callback client_id="..." client_secret="..." redirect_uri="...">
  <#{template>
    <script type="text/javascript">
    //<![CDATA[
    <#if condition="<#AMRequest.values['error'] checksum=1>">
      var success = false;
    <#else>
      var success = true;
    <#endif>
 
    (function(){
      if((window.opener !== null) && success){
        window.opener.location = window.opener.location;
      }
      window.close();
    })();
    //]]>
    </script>
  <#}template>    
<#}windowslive_oauth2callback>