带有api网关的AWS Cognito联邦身份

问题描述

我有一个使用api网关的离子应用程序。 api方法受认知用户池lambda授权者限制。在用户池中,我建立了一个Google联邦身份提供者,其作用域如下:[个人资料电子邮件openid]。我正在使用angular fire auth和google plus npm软件包来处理Google的登录。我可以登录提供商并获得令牌。我想使用该令牌访问我的api,但出现了cors错误。在没有提供者的情况下进行身份验证时,一切正常。以下是我尝试访问令牌的方式

Error: Access to XMLHttpRequest at 'https://api-gateway' from origin 'http://localhost:8100' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
import { AngularFireAuth } from '@angular/fire/auth';
import { GooglePlus } from '@ionic-native/google-plus/ngx';

login() {

  const provider = new firebase.auth.GoogleAuthProvider();
  const credential = await this.afAuth.auth.signInWithPopup(provider);
  credential.user.getIdToken()
   .then(res => {
     console.log(res);
}

enter image description here

})

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)