带有ui-router的adal.js永远不会发送给auth

时间:2016-11-08 14:17:40

标签: angularjs angular-ui-router adal

我正在使用adi.js和ui-router,并相信我已经正确配置了所有内容。不幸的是,在向我的州添加requireADLogin时,没有任何反应,我收到错误Failed to load template: ./dashboard.html (HTTP status: undefined undefined)

验证模块

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);
    }]);

信息中心模块

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: {

                }
            });
    }]);

根据chrome调试工具,应用程序甚至不会尝试重定向到auth门户网站:

chrome debug tools -> network

0 个答案:

没有答案