-
Notifications
You must be signed in to change notification settings - Fork 277
How to customize AWS Amplify Flutter endpoints to use LocalStack #6083
Copy link
Copy link
Closed
Labels
authIssues related to the Auth CategoryIssues related to the Auth CategoryquestionA question about the Amplify Flutter librariesA question about the Amplify Flutter libraries
Description
Environment
- Amplify Flutter Version: 2.2.0
- Amplify Auth Cognito Version: 2.2.0
- Flutter Version: 3.24.0
- Dart Version: 3.5.0
- Platform: Flutter Mobile App
Current Implementation
I'm currently using AWS Amplify in my Flutter application with the following plugins:
AmplifyAuthCognitofor authentication
My initialization code looks like this:
Future<void> configureAmplify() async {
try {
final auth = AmplifyAuthCognito();
await Amplify.addPlugins([auth]);
await Amplify.configure(amplifyconfig);
} on AmplifyAlreadyConfiguredException {
logger.d('Amplify was already configured.');
} catch (e) {
logger.d('An error occurred configuring Amplify: $e');
}
}Question
For local development and testing, I want to redirect all AWS API calls from Amplify to LocalStack instead of the actual AWS services.
Is there a way to configure Amplify Flutter to use custom endpoints for auth specifically ?
I'm looking for a way to modify the amplifyconfig or use some other configuration method to point to my LocalStack instance running at http://localhost:4566 instead of the actual AWS Cognito endpoints.
Extra
it's supported by the js client
Amplify.configure({
Auth: {
Cognito: {
// Lcoalstack configurations
userPoolId: "eu-west-1_localUserPoolId",
userPoolClientId: "userPoolClientId",
userPoolEndpoint: "http://localhost:4566/eu-west-1_localUserPoolId", <- notice
loginWith: {
email: true,
},
signUpVerificationMethod: "code",
userAttributes: {
email: { required: true },
},
},
},
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
authIssues related to the Auth CategoryIssues related to the Auth CategoryquestionA question about the Amplify Flutter librariesA question about the Amplify Flutter libraries