Azure B2C AD重定向到Angular应用 [英] Azure B2C AD Redirect to Angular App

查看:91
本文介绍了Azure B2C AD重定向到Angular应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行此Angular 4示例,该示例使用Azure B2C Active Directory和adal-angular 4.

I am trying to run this Angular 4 example that uses Azure B2C Active Directory and adal-angular 4.

要运行该应用程序,我在Azure中创建了一个租户,在AD B2C中注册了该应用程序,并添加了 https: //localhost:4200 .然后,我将应用程序ID和租户添加到了Angular应用程序中.

To run the app, in Azure I created a tenant, registered a the app in AD B2C and added a reply Url of https://localhost:4200. I then added the app id and tenant to my Angular App.

当我运行该应用程序时,它会正确重定向到 https://login.microsoftonline.com . .在加载时用于登录.正确登录将重定向到 https://localhost:4200 .

When I run the app, it correctly redirects to https://login.microsoftonline.com... on load for login. Logging in correctly redirects to https://localhost:4200.

我注销时出现问题.该应用程序被重定向到此静态注销页面,该页面不会重定向回我的应用程序

When I log out, there is a problem. The app is redirected to this static logout page which doesn't redirect back to my app.

我尝试在Azure Active Directory(不是B2C)中注册一个应用程序,将其配置数据移动到我的Angular应用程序中,当我运行该应用程序并注销时,它会临时重定向到,该页面会重定向回应用程序.

I tried registering an app in Azure Active Directory (not B2C), moving its config data into my Angular App, and when I run it and a log out it redirects temporarily to this "logging you out" page which redirects back to the app.

注销后的重定向URL与租户名称相同,只有B2C死亡. Chrome和Edge都会发生这种情况.

The the redirect urls after logout are identical other than the tenant name, only the B2C just dies. This happens in both Chrome and Edge.

我希望这不仅是B2C和常规AD之间功能上的差异.我检查了配置,但是也许这是我错过的Azure门户中的东西?

I expect that this is not just a difference in functionality between B2C and regular AD. I checked my configurations, but maybe this is something in the Azure portal I missed?

推荐答案

您应使用

ADAL ...旨在仅针对Azure AD经典"(例如-NOT B2C)

ADAL ... is designed to only work against Azure AD "classic" (e.g. - NOT B2C)

参考: MSAL或ADAL与Azure AD B2C和Xamarin一起使用的库

请参阅以下使用 /AzureAD/microsoft-authentication-library-for-js"rel =" nofollow noreferrer> MSAL.js .

See this Angular 4 example that uses MSAL.js.

这篇关于Azure B2C AD重定向到Angular应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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