in src/Amazon.Extensions.CognitoAuthentication/CognitoUserPool.cs [217:239]
public virtual async Task<CognitoUser> FindByIdAsync(string userID, CancellationToken cancellationToken)
{
if (string.IsNullOrEmpty(userID))
throw new ArgumentException(nameof(userID));
try
{
var response = await Provider.AdminGetUserAsync(new AdminGetUserRequest
{
Username = userID,
UserPoolId = this.PoolID
}, cancellationToken).ConfigureAwait(false);
return new CognitoUser(response.Username, ClientID, this, Provider, ClientSecret,
response.UserStatus.Value, response.Username,
response.UserAttributes?.ToDictionary(attribute => attribute.Name, attribute => attribute.Value) ?? new Dictionary<string, string>());
}
catch (UserNotFoundException)
{
return null;
}
}