从Office加载项内登录Office 365租户而不会弹出 [英] Login into Office 365 tenant from within Office add-in without pop-up

查看:162
本文介绍了从Office加载项内登录Office 365租户而不会弹出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果要访问Office 365 API和Office加载项,必须在应用程序中使用Azure AD登录屏幕.但是,这将始终导致弹出登录操作本身.有什么方法可以防止他弹出?

If I want to access an Office 365 API in and Office add-in I have to use the Azure AD login screen in my application. However, this will always result in a pop-up for the login action itself. Is there a way to prevent his pop-up?

推荐答案

实际上,您正在寻找一种确保外部域(托管Azure AD登录屏幕的外部域)的方法,例如 https://login.microsoftonline.com (适用于Office 365用户)显示在同一加载项框架中,而不是启动弹出窗口框架.尽管实际上有一种方法可以在外接程序清单中使用appdomains标记执行此操作(请参见 AppDomains ).

Actually, what you're looking for is a way to make sure that the external domain (where the Azure AD login screen is hosted, something like https://login.microsoftonline.com for Office 365 users) is showed within the same add-in frame rather than launching a popup frame. While there actually s a way to do this using the appdomains tag in your add-in manifest (see AppDomains).

尽管这最有效,但这实际上不是最佳实践,因为许多组织将联合登录用于其Azure AD,这意味着它们拥有自己的登录屏幕域.从理论上讲,如果您可以将它们全部添加进去,则无法提前知道域的内容,因此暂时弹出窗口是一种必不可少的弊端和最佳实践.

While this works for most, it is actually not a best practice because many organizations use federated logins for their Azure AD, which means they have their own login screen domains. Wile you could theoretically add them all there is no way of knowing in advance what the domain is going to be, so for the time being a pop-up is a necessary evil and a best practice.

这篇关于从Office加载项内登录Office 365租户而不会弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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