3

I'm using adal.js with ui-router and believe I have everything configured correctly. Unfortunately, when adding requireADLogin to my states, nothing happens and I get the error Failed to load template: ./dashboard.html (HTTP status: undefined undefined)

Auth module

angular
    .module('components.auth',
    [
        'ui.router',
        'AdalAngular'
    ])
    .config(['$httpProvider', 'adalAuthenticationServiceProvider', function($httpProvider, adalProvider) {

        adalProvider.init({
                instance: 'https://login.microsoftonline.com/',
                ...
                // these are components that can be loaded such as nav without needing authentication
                anonymousEndpoints: ['./root.html', './app.html', './app-nav.html', './app-sidebar.html']
            },
            $httpProvider);
    }]);

Dashboard module

var dashboard = {
    bindings: {
        //
    },
    templateUrl: './dashboard.html',
    controller: 'DashboardController'
};

angular
    .module('components.dashboard')
    .component('dashboard', dashboard)
    .config(['$stateProvider', 'adalAuthenticationServiceProvider', function ($stateProvider, adalProvider) {
        $stateProvider
            .state('dashboard', {
                parent: 'app',
                url: '/dashboard',
                component: 'dashboard',
                requireADLogin: true,
                resolve: {

                }
            });
    }]);

According to chrome debug tools, the application never even attempts to be redirected to an auth portal:

chrome debug tools -> network

logeyg
  • 549
  • 2
  • 8
  • 31
  • Probably the templateUrl for the dashboard is wrong. Please check quickly this Stack Overflow question: http://stackoverflow.com/questions/7591240/what-does-dot-slash-refer-to-in-terms-of-an-html-file-path-location. – Tome Pejoski Nov 16 '16 at 12:04
  • It would seem the ./dashboard.html template is not listed in your anonymous endpoints. – kbrimington Sep 22 '17 at 23:17

0 Answers0