AngularJS Module for Microsoft Azure Active Directory Authentication

Download this episode

Download Video

Download captions

Download Captions

Description

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

Embed

Format

Available formats for this video:

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

    The Discussion

    • User profile image
      Aram

      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
      Borgdylan

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

    • User profile image
      Jabbasoft

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

    • User profile image
      samdc98

      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
      Aram

      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

      Aram:
      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 () {
      authContext.clearCache();
      authContext.login();
      });
      and this for Sign out:
      $('#SignOut').on('click', function () {
      authContext.logOut();
      authContext.clearCache();
      });

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

      $(document).ready(function () {
      authContext.handleWindowCallback();

      if (authContext.getLoginError() == ""){
      $('#CurrectUser').html(authContext.getCachedUser().userName);
      $('#SignIn').hide();
      $('#SignOut').show();
      }
      else
      window.location = '/Home/LoginError?error=' + authContext.getLoginError();

    • User profile image
      Dickson

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

    • User profile image
      Barony

      @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.