首页 > 解决方案 > AWS Amplify Auth 弹出 IFrame

问题描述

我正在尝试使用AWS Amplify作为Outlook Add-In的基础。迄今为止,我一直在跳过一些问题。目前,我在加载项中正确呈现 Amplify Auth 时遇到问题。

以下代码:

 return (
        <div className='ms-welcome'>
            <button onClick={() => Auth.federatedSignIn()}>Sign In</button>
            <button onClick={checkUser}>Check User</button>
            <button onClick={signOut}>Sign Out</button>
        </div>
        );

产生此错误:

Load denied by X-Frame-Options: https://MY-DOMAIN.auth.us-east-1.amazoncognito.com/login?redi…WLot2C6lAkfPJgsxEsoMTUf_nPTODfKG4&code_challenge_method=S256 does not permit framing.

有什么方法可以让我将登录屏幕加载为弹出窗口?我不确定我想做的事情是否可行。

感谢所有的帮助!

标签: reactjsamazon-web-servicesoutlook-addinamazon-cognitoaws-amplify

解决方案


弹出窗口或类似窗口的推荐方法是使用对话框 API:https ://docs.microsoft.com/en-us/office/dev/add-ins/develop/dialog-api-in-office-add -ins。您可能还会发现office-js-helpers库对您的身份验证方案很有帮助。


推荐阅读