azure-ad-b2c - 使用 msal 连接到 Azure B2C - 状态参数

标签 azure-ad-b2c msal

我使用的样本来自:https://github.com/Azure-Samples/active-directory-b2c-javascript-msal-singlepageapp作为实现 B2C 注册的基础。

如何在示例中传递 state 参数?我看到有一个关于状态的问题,所以我想可以在示例中使用状态。但是,我无法弄清楚如何使用它以及在返回 token 后如何检索它。

最佳答案

在审查 source code for MSAL.js ,我不明白你如何控制state的值. AuthenticationRequestParameters未暴露且值stateAuthenticationRequestParameters 时设置为新的 guid是 constructed .

示例 :

在以下 MSAL.js 代码中,我们无法控制 authenticationRequest多变的。

loginRedirect(scopes? : Array<string> , extraQueryParameters? : string): void {
    ...

    this.authorityInstance.ResolveEndpointsAsync()
    .then(() => {
        const authenticationRequest = new AuthenticationRequestParameters(this.authorityInstance, this.clientId, scopes, ResponseTypes.id_token, this._redirectUri);
        ...
    });
    ...
}

关于azure-ad-b2c - 使用 msal 连接到 Azure B2C - 状态参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45705403/

相关文章:

ios - MSAL 从 iOS Swift 示例返回错误 token

javascript - 使用 Axios 将 MSAL token 发送到后端

ios - MSAL - 在 iOS 上获取用户名

MSAL 用户代理应用程序 : Local storage not working

azure - 我可以通过自己的登录表单使用 Azure B2C 吗?

azure-ad-b2c - Azure AD B2C 连接用户使用 Graph AD API 更改密码

angular - 如何使用 typescript 在 angular2 应用程序中实现 AAD B2C 功能?

azure - 在没有 Azure Front Door 的情况下使用 Azure AD B2C 自定义域

adal - 无法使用msal-browser静默或通过重定向获取 token

azure - headless 身份验证 Azure AD b2c