Access Cognito User From Different Region

0

I have an existing API in us-east-2 saving to a us-east-2 Cognito Pool. I migrated the API and we're now on us-east-1. I have noticed the following:

  1. Old API can still create/login new/existing users fine.
  2. New API can only create new users and login those users. Cannot login with existing users due to: An error occurred (NotAuthorizedException) when calling the GetUser operation: Access Token has been revoked
  3. Old API can login with users created with new API.
  4. New and old API are saving users to the same Cognito pool

I'm confused why the old API on us-east-2 can access the users created by the new API on us-east-1 but the inverse fails. Also, why the new API can create/login new users without an issue, but can't do that with existing users?

Just looking to confirm my issue is regional specific or something else?

Joe
已提問 3 個月前檢視次數 134 次
1 個回答
1

Verify that the API is using the correct region-specific endpoint for Cognito. Each AWS region has its own endpoint, and if your API is pointing to the wrong regional endpoint, it could cause authorization issues. The error message "Access Token has been revoked" indicates an issue with token management. Investigate how tokens are being handled and revoked in your system. There might be a discrepancy in how tokens are being managed between the two APIs. Check if there are any lifecycle events or triggers in your Cognito setup that might be revoking tokens unexpectedly when accessed from the new region.

profile picture
Jagan
已回答 3 個月前
  • I cloned my API into us-east-2 and I'm still having the same problems..

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南