Authentication MSAL SSO:如何在子iframe中获取父窗口的登录帐户信息?

Authentication MSAL SSO:如何在子iframe中获取父窗口的登录帐户信息?,authentication,session,iframe,oauth-2.0,msal,Authentication,Session,Iframe,Oauth 2.0,Msal,我在任何web应用程序(Yammer、团队等)的iframe中使用MSAL JS进行静默身份验证。根据文档和各种用户问答,我们需要将帐户信息(名称或会话)传递给acquireTokenSilent方法。否则它将拒绝声明createUserLoginRequiredError 我尝试将应用程序范围作为请求传递,但它无法在没有用户交互的情况下进行身份验证,并点击catch块,因为它没有loginHint来进行SSO那么,如果我在父窗口中获得了身份验证,如何获取登录点。在ADAL中,我们可以使用dis

我在任何web应用程序(Yammer、团队等)的iframe中使用MSAL JS进行静默身份验证。根据文档和各种用户问答,我们需要将帐户信息(名称或会话)传递给acquireTokenSilent方法。否则它将拒绝声明createUserLoginRequiredError

我尝试将应用程序范围作为请求传递,但它无法在没有用户交互的情况下进行身份验证,并点击catch块,因为它没有loginHint来进行SSO那么,如果我在父窗口中获得了身份验证,如何获取登录点。在ADAL中,我们可以使用displaycall并替换prompt=none。如何在MSAL中执行类似的SSO

我试过下面的代码

const requestObj = {
            scopes: [ Appresource ]
        };
 myUserAgentApplication.acquireTokenSilent( requestObj ).then( () => {

                // Success
            } )
                .catch( ( exception ) => {

                    // Failure
                    myUserAgentApplication.loginPopup( requestObj ).then( () => {

                        // Success after interaction.
                    } )
}
MSAL.js:

UserAgentApplication.prototype.acquireTokenSilent = function (userRequest) {
        var _this = this;
        // validate the request
        var request = RequestUtils_1.RequestUtils.validateRequest(userRequest, false, this.clientId);
        return new Promise(function (resolve, reject) {
            // block the request if made from the hidden iframe
            WindowUtils_1.WindowUtils.blockReloadInHiddenIframes();
            var scope = request.scopes.join(" ").toLowerCase();
            // if the developer passes an account, give that account the priority
            var account = request.account || _this.getAccount();
            // extract if there is an adalIdToken stashed in the cache
            var adalIdToken = _this.cacheStorage.getItem(Constants_1.Constants.adalIdToken);
            // if there is no account logged in and no login_hint/sid is passed in the request
            if (!account && !(request.sid || request.loginHint) && StringUtils_1.StringUtils.isEmpty(adalIdToken)) {
                _this.logger.info("User login is required");
                return reject(ClientAuthError_1.ClientAuthError.createUserLoginRequiredError());
            }
...............................
...............................