- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Azure AD B2C 门户生成 token 。当我使用loginPopup方法时,我可以成功生成 token ,但在使用loginRedirect时得到未定义
。
这是代码:
clientApplication = new Msal.UserAgentApplication(
this.tenantConfig.clientID, this.authority,
function (errorDesc: any, token: any, error: any, tokenType: any) {
// Called after loginRedirect or acquireTokenPopup
}
);
public login(): void {
var _this = this;
// loginRedirect loginPopup
this.clientApplication.loginPopup(this.tenantConfig.b2cScopes).then(function (idToken: any) {
_this.clientApplication.acquireTokenSilent(_this.tenantConfig.b2cScopes).then(
function (accessToken: any) {
_this.access_token = accessToken;
}, function (error: any) {
_this.clientApplication.acquireTokenPopup(_this.tenantConfig.b2cScopes).then(
function (accessToken: any) {
_this.access_token = accessToken;
}, function (error: any) {
bootbox.alert("Error acquiring the popup:\n" + error);
});
})
}, function (error: any) {
bootbox.alert("Error during login:\n" + error);
});
console.log(`access token service file ${_this.access_token}`);
}
请告诉我我犯了什么错误?是范围问题还是回调方法问题?
最佳答案
我找到了reference 。通过这个我能够获得访问 token 。您将在 sessionStorage.getItem('msal.idtoken')
中获取它。
关于angular - 在 Azure AD B2C 门户中使用 loginRedirect 生成访问 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46241091/
我试图在 CakePHP 应用程序中按照我的喜好进行身份验证,但遇到了麻烦。 我想让用户从主页或专用登录页面登录。我正在使用 Auth 组件来管理登录,现在登录本身可以正常工作。我将主页上的表单提交到
我正在尝试使用 Azure AD B2C 为 Angular 2+ 应用程序实现身份验证。发现这个很棒 example .但是,该示例在弹出窗口中进行身份验证。我宁愿使用重定向而不是弹出窗口。 MSA
我们正在使用 Active Directory (Azure AD) v2.0 端点并使用 msal.js 进行登录及其反复请求登录 let app = new Msal.UserAgentAppli
我正在使用 Azure AD B2C 门户生成 token 。当我使用loginPopup方法时,我可以成功生成 token ,但在使用loginRedirect时得到未定义。 这是代码: clien
我正在使用 Azure AD B2C 门户生成 token 。当我使用loginPopup方法时,我可以成功生成 token ,但在使用loginRedirect时得到未定义。 这是代码: clien
我目前正在使用 msal.js 包,以便我可以为我自己的 Vue.js 应用程序使用 azure 授权。 到目前为止,我已经创建了一个 Teams 应用程序,可以在其中访问我的 Vue.js 网站,该
我是一名优秀的程序员,十分优秀!