- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前正在尝试连接到我的 AD 以接收缓存的用户/ token 或我自己的 Vue.js 应用程序在我的团队应用程序中的新 token 。
到目前为止,我已经创建了一个 Teams 应用程序来获取我的用户的上下文、一个 Azure 应用程序连接到和一个 Vue.js 应用程序来测试 microsoftTeams SDK 和 Adal.js 包。
这是我目前的方法:
import * as microsoftTeams from '@microsoft/teams-js';
import * as AuthenticationContext from 'adal-angular/lib/adal';
// some other code that is not relevant to this...
async loginWithTeamsCredentials() {
await microsoftTeams.initialize();
microsoftTeams.getContext(async (context) => {
const { loginHint } = context;
const config = {
clientId: 'some ClientID that I replaced with nonsense for this stackoverflow post',
redirectUri: 'https://login.microsoftonline.com/common/oauth2/nativeclient',
cacheLocation: 'localStorage',
navigateToLoginRequestUrl: false,
};
if (loginHint) {
config.extraQueryParameter = `scope=openid+profile&login_hint=${encodeURIComponent(
loginHint,
)}`;
} else {
config.extraQueryParameter = 'scope=openid+profile';
}
const authContext = new AuthenticationContext(config);
const user = await authContext.getCachedUser();
console.log(user);
});
},
最佳答案
我认为您的问题是您使用 adal.js 而不是 Azure AD v2 所需的 msal.js。使用 msal.js 和相应的方法,您应该获得连接。
另一件事是您不能在 Teams 中使用 msal 进行静默身份验证。但我无法告诉您如何仅从 Teams SDK 获取信息。
关于adal - 如何检查 AuthenticationContext 是否与 Azure AD 有连接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59209405/
我希望能够以编程方式从 Azure 获取 token 。 我调用 GetAToken().Wait(); 但失败了。 方法是: public async Task GetAToken() {
使用 ADAL 库获取 WAAD token ,我想知道如何更好地控制登录流程。 var ac = new AuthenticationContext("https://login.windows.n
我正在尝试使用 Microsoft Power BI REST API,但由于我对该 API 的经验不是很丰富,所以没有取得多大进展 据我了解,身份验证上下文是身份模型事件目录的一部分,我会三次检查它
首先,我不确定这是否重要,但由于@Simon Mourier 在 him answer 中提到的原因,我正在使用 ADAL 的实验版本, this one . 在下面的代码中,我想同步获取一个Auth
使用 Azure Active Directory 图形客户端 API,如何配置底层 HttpClient 以使用 HttpClientHander,在其中我可以定义经过身份验证的应用程序代理? va
使用 Azure Active Directory 图形客户端 API,如何配置底层 HttpClient 以使用 HttpClientHander,在其中我可以定义经过身份验证的应用程序代理? va
我有一个在 Multi-Tenancy 场景中使用的 native 应用程序。为了对用户进行身份验证——并征得他们同意允许此应用程序代表他们访问 Azure——我只需实例化一个 Authenticat
我正在构建一个 WPF 应用程序,并且现在每次启动时都使用 ADAL 中的 AuthenticationContext,并且希望以某种方式缓存访问 token ,而不必在每次应用程序启动时提示用户。
ADAL library for Windows Phone 8.1 的实现示例可以在 GitHub 上找到 要为调用AuthenticationContext.AcquireTokenAndCont
我目前正在尝试连接到我的 AD 以接收缓存的用户/ token 或我自己的 Vue.js 应用程序在我的团队应用程序中的新 token 。 到目前为止,我已经创建了一个 Teams 应用程序来获取我的
我正在使用 ADAL.js 获取 Azure 资源的 token 。 为此,我编写了以下代码: var endpoints = {
我想运行 Java 代码以在 Windows 服务器中使用代理读取 Azure KeyVault。 我浏览了很多帖子,但可以找到任何可行的解决方案。主要针对 c#,但我想要针对 Java。我的代码在本
我正在关注 tutorial用于通过 AAD 对 Power BI REST API 进行身份验证。 本教程使用 C# 和 ADAL。它通过以下方式获取 token , AuthenticationC
当我从 Windows 应用商店应用 HTML/Javascript 调用 AuthenticationContext 方法时,出现错误。 代码如下: var adal = Microsoft.Ide
我使用 Angular1 构建了一个小型测试应用程序,该应用程序使用 ADAL 连接到 Office365 租户。由于我希望开始包含 Angular2 组件,因此我尝试使用 JSPM 和 System
如果我错过了这篇文章中的某些内容,我深表歉意,因为我在阅读了几个小时后已经束手无策。 我正在尝试编写一个后端服务 (Windows),它将通过 Azure AD 连接到 MS Graph API。我正
我正在使用 Azure AD 验证我的单页应用程序 (Angular4),并为此使用 Adal.js。在登录页面上,我单击一个重定向到 Microsoft AAD 的按钮,成功登录后它重定向回应用程序
我是一名优秀的程序员,十分优秀!