How to log withAuthenticator to understand why this error is occurring when I try to sign in?

0

I am trying to sign in with a user that I have just created. Cognito even shows this user in the user pool: user pool

And the identity pool id matches up between the identity pool section of Cognito and aws-exports.js under 'aws_cognito_identity_pool_id'.

The code I have used is all from this tutorial and I have followed every step (https://blog.logrocket.com/aws-amplify-react-native-tutorial-examples/)

Can anyone help me work out why I am not able to progress to the signed in state? Providing some logs here would be helpful, but I am not used to withAuthenticator so I'm not sure whats the best way to do this.

import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
import { Amplify } from 'aws-amplify';
import awsExports from './src/aws-exports';
import { withAuthenticator } from '@aws-amplify/ui-react-native';
Amplify.configure(awsExports);
function App() {
  return (
    <View style={styles.container}>
      <Text>Open up App.js to start working on your app!</Text>
      <StatusBar style="auto" />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

export default withAuthenticator(App)

screenshot of the error

2 Answers
0

Amazon Cognito supports several AWS services for monitoring and maintaining the reliability, availability, and performance of your organization and user activity:

AWS CloudTrail: Captures API calls from the Cognito console and code calls to the Cognito API operations. It records details like the IP address, who made the request, and when it was made, especially during user authentication events.

Amazon CloudWatch Logs: Allows you to send fine-grained logs of user activity to a log group, which can be helpful for troubleshooting issues like email and SMS message delivery to users.

Amazon CloudWatch Metrics: Enables you to monitor, report, and take automatic actions in near real-time based on various metrics related to your Amazon Cognito user pools. You can create dashboards or alarms based on these metrics.

Amazon CloudWatch Logs Insights: Allows you to configure CloudTrail to send events to CloudWatch for monitoring Amazon Cognito CloudTrail log files.

In summary, these AWS services provide comprehensive monitoring and logging capabilities for Amazon Cognito, allowing you to track user activity, API calls, and various metrics to ensure the reliability and performance of your authentication and authorization systems.

Additional information on how to setup and enable those logs can be found in Cognito Developer Guide Logging and monitoring

AWS
answered 18 days ago
profile picture
EXPERT
reviewed 17 days ago
  • The cloudwatch logs for my app in the correct log group does not show any error as occurring. The same with the other places you mentioned there should be an error log

0

As your aim is to investigate and analyze API calls rather than usage patterns, the CloudTrail logs would be a valuable resource. CloudTrail captures a subset of API calls made to Amazon Cognito, recording them as events. This includes calls initiated from the Amazon Cognito console as well as those made through code calls to the Amazon Cognito API operations You can find additional information about CloudTrail and Cognito in this link as well as information about the CloudTrail Cognito sign-in events in this link

AWS
answered 17 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions