Skip to content

faceliveness error: No credentials provided at credentialProvider

0

Hi, I am trying to implement Faceliveness Detector with Amplify UI components. I followed to the letter the documentation of: https://ui.docs.amplify.aws/react/connected-components/liveness with Amplify Gen 1. But I always get this error: No credentials provided at credentialProvider.

I go a couple of days with this error.

this is my component: <ThemeProvider> {loading ? ( <Loader /> ) : ( <FaceLivenessDetector sessionId={createLivenessApiData} region="us-east-1" onAnalysisComplete={handleAnalysisComplete} onError={(error) => { console.log('Error:', error); console.log('Error with sessionId:', createLivenessApiData); console.error(error); }} /> )} </ThemeProvider> Note: createLivenessApiData already is the sessionId. and this is my homepage:

Amplify.configure(awsconfig)

export default function Home() { return ( <div className={"w-[75%] h-screen"}> <LivenessQuickStartReact /> </div> ); }

my awsconfig just have the region, Is it correct?

and it is the especific error: state: 'SERVER_ERROR', error: Error: No credentials provided at credentialProvider (webpack-internal:///(app-pages-browser

1 Answer
0

The error you're encountering suggests that there's an issue with the authentication setup for your Amplify project. The "No credentials provided" error typically occurs when the AWS SDK cannot find the necessary credentials to make API calls.

To resolve this issue, you need to ensure that your Amplify project is properly configured with the correct authentication settings. Here are some steps you can take:

  1. Make sure you've added authentication to your Amplify project. You can do this by running amplify add auth in your project directory and following the prompts.

  2. After adding auth, make sure to run amplify push to update your backend and generate the necessary configuration files.

  3. Your awsconfig file should contain more than just the region. It should include information about your Cognito User Pool and Identity Pool. Make sure you're importing the correct awsconfig file that Amplify generates.

  4. In your main App component or entry point, ensure you're configuring Amplify correctly. It should look something like this:

import { Amplify } from 'aws-amplify';
import awsconfig from './aws-exports';
Amplify.configure(awsconfig);
  1. If you're allowing unauthenticated access, make sure you've configured the IAM roles correctly. The unauthenticated role should have the necessary permissions to access the Face Liveness service.

  2. Check that you've set up the correct IAM permissions for the Face Liveness service. This includes permissions for both authenticated and unauthenticated roles if you're using them.

  3. Ensure that you're using the latest version of the Amplify libraries and SDKs, as older versions may not support the Face Liveness feature correctly.

If you've followed these steps and are still encountering issues, you may need to check your network connectivity and ensure that your application can reach the AWS services. Also, double-check that you're using the correct AWS region in your configuration.

Remember that the Face Liveness feature requires the use of the Amplify SDK, so make sure it's properly integrated into your project.
Sources
Face Liveness FAQ - Amazon Rekognition
Detect real users with AWS Amplify and Face Liveness | Front-End Web & Mobile

answered 2 years ago

  • I already checked and configured again and even ran the amplify push command and everything is fine, however, I still have the same problem.

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.