【发布时间】:2019-09-13 01:36:30
【问题描述】:
在我的 Angular 项目中,我使用 OAuth and Hosted UI 配置了 AWS Amplify。
一切正常。当我想与 Google 建立联系时,我会被重定向回一个类似 http://localhost:4200/?code=de79bfa4-xxxxxx&state=2xxxxxx 的网址,该网址由 AWS Amplify Hub 很好地处理。
现在,我想在我的项目中配置 Stripe Connect,它也使用OAuth connection flow。
所以我通过添加如下链接来配置文档中定义的 OAuth 链接:
<a class="stripe-connect" href="https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_xxxxxx&scope=read_write"><span>Connect with Stripe</span></a>
问题
我被重定向回一个类似http://localhost:4200/stripe?scope=read_write&code=ac_xxxxxx的网址
不幸的是,这个 url 也被 Amplify 处理了,我收到以下错误消息:
zone.js:1152 发布https://[domain].amazoncognito.com/oauth2/token 400
core.js:15724 ERROR 错误:未捕获(在承诺中):错误:invalid_grant
错误:invalid_grant
这是可以理解的,因为 Amplify 尝试处理 Stripe Connect 代码..
但我不知道如何纠正这种行为。
有解决这个问题的办法吗?
复制
- 使用 Amplify Auth Hosted UI 配置示例存储库
- 编辑
stripe.component.html中的 Stripe client_id - 启动项目
- 与谷歌联系
- 导航到设置
- 点击链接“Connect with Stripe”
- 在 Stripe 表单上,点击“忽略此帐户表单”
- 查看错误
【问题讨论】:
标签: angular stripe-payments aws-amplify