UI的路由器404 ADAL重定向时 [英] Ui-Router 404 when redirecting with ADAL

查看:166
本文介绍了UI的路由器404 ADAL重定向时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正试图在Azure Directory身份验证库(ADAL.JS)在挂接到UI的路由器。我知道了有线的,它正确地重定向,但重定向之前,它总是夹头404。重定向的工作原理,然后被送回我的应用程序,它显示404。

I'm currently trying to hook in the Azure Directory Authentication Library (ADAL.JS) into UI-Router. I've got it wired in, and it redirects correctly, but it always chucks a 404 before the redirect. The redirect works, and then gets sent back to my application, which is showing the 404.

我修改了状态,像这样:

I've modified the state like so:

        {
            state: 'admin',
            config: {
                url: '/admin',
                templateUrl: 'app/admin/admin.html',
                controller: 'AdminController',
                controllerAs: 'vm',
                title: 'Admin',
                settings: {
                    nav: 2,
                    content: '<i class="fa fa-lock"></i> Admin'
                },
                requireADLogin: true
            }

我知道了与正常角RouteProvider的工作,并没有404被抛出。

I've got it working with the normal Angular RouteProvider, and no 404 is being thrown.

应用程序我试图把它变成下探由约翰·帕帕斯呦热毛巾发生器产生。

The application I'm attempting to plumb it into was generated by John Papas Yo Hot Towel generator.

推荐答案

这看起来像adal.js.一个bug UI的路由器使用状态的变化。我看到在设置起始页比较路由变化处理状态变化的一个区别。它应该是:

This looks like a bug in adal.js. ui-router is using state changes. I see one difference in setting the start page for state changes comparing to the route change handler. It should be :

_adal._saveItem(_adal.CONSTANTS.STORAGE.START_PAGE, $location.$$path);

而不是

_adal._saveItem(_adal.CONSTANTS.STORAGE.START_PAGE, nextRoute.url);

这篇关于UI的路由器404 ADAL重定向时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆