AngularJS Module for Microsoft Azure Active Directory Authentication

Download this episode

Download Video

Download captions

Download Captions


Join your guide Cory Fowler as he talks to the product teams in Redmond as well as the web community.

This week Vittorio Bertocci joins us to demonstrate a new Azure Active Directory library, for JavaScript. This module is implemented using AngularJS and enables the ability to do single sign-on from your front-end JavaScript code. Vittorio ends the segment with a white boarding session to discuss how the module functions.

Show Links



Available formats for this video:

Actual format may change based on video formats available and browser capability.

    The Discussion

    • User profile image

      Hi, Thanks guys, this was very useful, specially the white-boarding..
      Do I need to have AngularJS for this to work? How can i Initial and inject the httpProvider if i am not using Angular and have just a simple html page?

    • User profile image

      The $httpProvider is an angular service so you cannot use it outside of angular.

    • User profile image

      I see the identity guru still hasn't been to the barbers :) Disappointed I couldn't attend DEV-B322...

    • User profile image

      How do we add additional claims in the ADAL.js scenario? Is there a way similar to using the ClaimsTransformationModule to add additional claims?

    • User profile image

      Thanks Guys,
      I actually got it working without using Angular.
      Thanks Again

    • User profile image
      Mike Walsh

      Good work guys! Is there any easy way to implements this, or Azure AD in general in a scenario where we do not want to redirect to a login page? In our SPA, we want to be able to have our own login dialogue, in app. Basically, we want to skip login redirect and just send the username/password through a POST to a secure REST api with CORS. Suggestions?

    • User profile image
      Sam Dzirasa

      What changes did you make to get it to work without using Angular?

    • User profile image
      Aram Koukia

      For the SignIn i put and element and called the login like this:
      $('#SignIn').on('click', function () {
      and this for Sign out:
      $('#SignOut').on('click', function () {

      and in the Secured html page used this to show the user name or show the auth error:

      $(document).ready(function () {

      if (authContext.getLoginError() == ""){
      window.location = '/Home/LoginError?error=' + authContext.getLoginError();

    • User profile image

      Thanks Guys,will this also work for on perm. active directory

    • User profile image

      @Dickson:Agree with you. To my mind very good to see support for this given the SharePoint Hosted App based Single Page Apps model being developed.

    Comments closed

    Comments have been closed since this content was published more than 30 days ago, but if you'd like to send us feedback you can Contact Us.