配置Angular 4.5路由以接受Azure B2C回复URL身份验证令牌

时间:2018-01-16 08:23:17

标签: angular azure azure-authentication

我正在开发Angular 4.5应用程序,我需要使用Azure-B2C进行身份验证。我已完成身份验证,但我在azure

中回复Url配置时收到一个错误或另一个错误

我在Angular应用中设置路由设置为http://localhost:4000/#/app/dashboard 这是始终称为主页的默认路由

 import { Routes, RouterModule }  from '@angular/router';
 import { Layout } from './layout.component';

 const routes: Routes = [
{ path: '', component: Layout, children: [
{ path: '', redirectTo: 'dashboard', pathMatch: 'full' },
{ path: 'dashboard', loadChildren: '../dashboard/dashboard.module#DashboardModule' },

]}
];

     export const ROUTES = RouterModule.forChild(routes);

方案一错误

如果我在Azure中设置 - >应用程序'回复URL'http://localhost:4000我设法获得Azure登录页面但是在登录为azure后抛出错误找不到返回URL。这通常是

http://localhost:4000/#state=

场景二错误

如果我设置了回复网址http://localhost:4000/#/app/dashboard,那么它就找不到来自azure的登录页面

我需要帮助来配置Azure以使用身份验证令牌回复路由。

任何有关路由的建议都会很棒

0 个答案:

没有答案