title: Is there a javascript library to obtain authentication token with Windows Azure Active Directory
body: <p>I have a number of web services created using Microsoft MVC4 Web Api and protected using WIF and Windows Azure Active Directory (WAAD) using WS-Fed.</p>
  
  <p>I also have a pure HTML5/Javascript single page application (SPA) client that needs to access these web api's.</p>
  
  <p>Are there any known samples/libraries in Javascript for handling the interactions with WAAD to</p>
  
  <ul>
  <li>Determine if the user is already logged in.</li>
  <li>Log in the user and obtain a security token if required</li>
  <li>Log out once interaction is finished.</li>
  </ul>
  
  <p>If not, are there any recommended links to the documentation required to implement something like that.</p>