Skip to content

Commit ee8feea

Browse files
jboshoven-emporiacadivus
authored andcommitted
Support for cognito endpoint
Added ability to add equivalent of AWS_ENDPOINT_URL to cognito user pool requests. This is done by adding `CognitoUserPool > Default > Endpoint` to the configuration. The endpoint must contain the pool ID like `http://localhost:4556/us-east-1_pool_id`.
1 parent 078c7ba commit ee8feea

File tree

6 files changed

+16
-1
lines changed

6 files changed

+16
-1
lines changed

packages/amplify_core/lib/src/config/amplify_outputs/auth/auth_outputs.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class AuthOutputs
2020
required this.awsRegion,
2121
this.userPoolId,
2222
this.userPoolClientId,
23+
this.userPoolEndpoint,
2324
this.appClientSecret,
2425
this.identityPoolId,
2526
this.passwordPolicy,
@@ -44,6 +45,9 @@ class AuthOutputs
4445
/// The Cognito User Pool Client ID.
4546
final String? userPoolClientId;
4647

48+
/// The Cognito User Pool Endpoint.
49+
final String? userPoolEndpoint; //Gen 1 only
50+
4751
/// A fixed string that must be used in all API requests to the app client
4852
/// if the the app client has one configured.
4953
///
@@ -84,6 +88,7 @@ class AuthOutputs
8488
awsRegion,
8589
userPoolId,
8690
userPoolClientId,
91+
userPoolEndpoint,
8792
identityPoolId,
8893
oauth,
8994
standardRequiredAttributes,

packages/amplify_core/lib/src/config/amplify_outputs/auth/auth_outputs.g.dart

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/amplify_core/lib/src/config/auth/auth_config.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ class AuthConfig extends AmplifyPluginConfigMap {
137137
awsRegion: region,
138138
userPoolId: userPool?.poolId,
139139
userPoolClientId: userPool?.appClientId,
140+
userPoolEndpoint: userPool?.endpoint,
140141
appClientSecret: userPool?.appClientSecret,
141142
identityPoolId: identityPool?.poolId,
142143
passwordPolicy: passwordPolicy,

packages/amplify_core/test/config/amplify_outputs_mapping/data/amplify_outputs.g.dart

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/amplify_core/test/config/amplify_outputs_mapping/data/amplifyconfiguration.g.dart

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/auth/amplify_auth_cognito_dart/lib/src/state/machines/configuration_state_machine.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ final class ConfigurationStateMachine
7878
region: authOutputs.awsRegion,
7979
credentialsProvider: _credentialsProvider,
8080
dependencyManager: this,
81+
endpoint: authOutputs.userPoolEndpoint,
8182
),
8283
);
8384

0 commit comments

Comments
 (0)