Cognito User Pool 的 initiateAuth() 不支援自訂scope

最近公司某專案因為要讓 C# client 接上 Cognito,不過在 OAuth2 的 redirect 有困難,
所以我又想試試看讓 C# client 透過 AWS SDK 的 cognito.initiateAuth() 讓使用者做登入。

我是用 Vue.js 來寫 POC,
登入成功之後發現拿到的 access_token 的 scope 只有 aws.congito.signin.user.admin 一個。
這個 bug 會讓我們的 access_token 無法通過 API Gateway 的 JWT Authorizer 認証。

這個情況在 AWS Cognito AdminInitiateAuth all custom scopes are missing 這篇文章也有提到,
另外在 Custom scopes in access token programmatically #684 這篇有人在向 AWS 許願可以讓 initiateAuth() 支援自訂 scope。
這篇留言提到可以用 Pre token generation 修改 ID token 的內容,well…

Cognito 跟 AppSync 在充滿 roadblock 的部份實在是很像…


日期

作者

留言

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *