Closed LoopIssuer closed 1 year ago
Hi @TomaszWozniakMosina,
Good morning.
Unfortunately, the issue is not reproducible using the below code (only for demonstration purposes):
using Amazon.CognitoIdentityProvider;
using Amazon.CognitoIdentityProvider.Model;
using System.Threading.Tasks;
namespace TestConsoleApp_NetFramework
{
internal class Program
{
static string userPoolId = "<<user-pool-id>>";
static void Main(string[] args)
{
string email = "<<valid-email-address>>";
var response = ListCognitoUsers(userPoolId, email).Result;
}
private static async Task<ListUsersResponse> ListCognitoUsers(string userPoolId, string email)
{
AmazonCognitoIdentityProviderClient client = new AmazonCognitoIdentityProviderClient(Amazon.RegionEndpoint.USEast2); // Set the region endpoint appropriately.
var request = new ListUsersRequest() { UserPoolId = userPoolId, Filter = $"email=\"{email}\"" };
return await client.ListUsersAsync(request);
}
}
}
Please check if you have configured the AWS credentials properly (with proper IAM policy/permission to list users) in your profile chain to access Cognito service.
Thanks, Ashish
This issue has not received a response in 5 days. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.
Describe the bug
I got the error, when trying to use ListUsersRequest (in forgotten password flow )
Missing Authentication Token Amazon.Runtime.Internal.HttpErrorResponseException: Exception of type 'Amazon.Runtime.Internal.HttpErrorResponseException' was thrown.
Expected Behavior
No error, get a list of registered users from Cognito.
Current Behavior
Error is thrown: Missing Authentication Token Amazon.Runtime.Internal.HttpErrorResponseException: Exception of type 'Amazon.Runtime.Internal.HttpErrorResponseException' was thrown.
Reproduction Steps
Use this method to get list of available users:
Possible Solution
No response
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
Unity 2021.3.9 Aws sdk .net
Targeted .NET Platform
.Net 4.x
Operating System and version
Windows 11