diff --git a/aws-auth-cognito/src/main/java/com/amplifyframework/auth/cognito/AuthConfiguration.kt b/aws-auth-cognito/src/main/java/com/amplifyframework/auth/cognito/AuthConfiguration.kt index e5faf738b..e70216fc4 100644 --- a/aws-auth-cognito/src/main/java/com/amplifyframework/auth/cognito/AuthConfiguration.kt +++ b/aws-auth-cognito/src/main/java/com/amplifyframework/auth/cognito/AuthConfiguration.kt @@ -177,7 +177,7 @@ data class AuthConfiguration internal constructor( ), identityPool = identityPool, oauth = oauth, - authFlowType = auth.authenticationFlowType.toConfigType(), + authFlowType = AuthFlowType.USER_SRP_AUTH, signUpAttributes = auth.standardRequiredAttributes, usernameAttributes = auth.usernameAttributes.map { it.toConfigType() }, verificationMechanisms = auth.userVerificationTypes.map { it.toConfigType() }, @@ -223,11 +223,6 @@ data class AuthConfiguration internal constructor( func(it) } - private fun AmplifyOutputsData.Auth.AuthenticationFlowType.toConfigType() = when (this) { - AmplifyOutputsData.Auth.AuthenticationFlowType.USER_SRP_AUTH -> AuthFlowType.USER_SRP_AUTH - AmplifyOutputsData.Auth.AuthenticationFlowType.CUSTOM_AUTH -> AuthFlowType.CUSTOM_AUTH - } - private fun AmplifyOutputsData.Auth.UsernameAttributes.toConfigType() = when (this) { AmplifyOutputsData.Auth.UsernameAttributes.Email -> UsernameAttribute.Email AmplifyOutputsData.Auth.UsernameAttributes.PhoneNumber -> UsernameAttribute.PhoneNumber diff --git a/aws-auth-cognito/src/test/java/com/amplifyframework/auth/cognito/AuthConfigurationTest.kt b/aws-auth-cognito/src/test/java/com/amplifyframework/auth/cognito/AuthConfigurationTest.kt index 970141d3a..cb97711b9 100644 --- a/aws-auth-cognito/src/test/java/com/amplifyframework/auth/cognito/AuthConfigurationTest.kt +++ b/aws-auth-cognito/src/test/java/com/amplifyframework/auth/cognito/AuthConfigurationTest.kt @@ -180,7 +180,6 @@ class AuthConfigurationTest { userPoolId = "userpool" userPoolClientId = "userpool-client" identityPoolId = "identity-pool" - authenticationFlowType = AmplifyOutputsData.Auth.AuthenticationFlowType.CUSTOM_AUTH passwordPolicy { requireLowercase = true requireSymbols = true @@ -203,7 +202,7 @@ class AuthConfigurationTest { val configuration = AuthConfiguration.from(data) - configuration.authFlowType shouldBe AuthFlowType.CUSTOM_AUTH + configuration.authFlowType shouldBe AuthFlowType.USER_SRP_AUTH configuration.userPool.shouldNotBeNull().run { region shouldBe "test-region" poolId shouldBe "userpool" @@ -243,13 +242,12 @@ class AuthConfigurationTest { awsRegion = "test-region" userPoolId = "userpool" userPoolClientId = "userpool-client" - authenticationFlowType = AmplifyOutputsData.Auth.AuthenticationFlowType.CUSTOM_AUTH } } val configuration = AuthConfiguration.from(data) - configuration.authFlowType shouldBe AuthFlowType.CUSTOM_AUTH + configuration.authFlowType shouldBe AuthFlowType.USER_SRP_AUTH configuration.userPool.shouldNotBeNull().run { region shouldBe "test-region" poolId shouldBe "userpool" diff --git a/core/src/main/java/com/amplifyframework/core/configuration/AmplifyOutputsData.kt b/core/src/main/java/com/amplifyframework/core/configuration/AmplifyOutputsData.kt index 33651bbdd..630a51034 100644 --- a/core/src/main/java/com/amplifyframework/core/configuration/AmplifyOutputsData.kt +++ b/core/src/main/java/com/amplifyframework/core/configuration/AmplifyOutputsData.kt @@ -22,7 +22,6 @@ import com.amplifyframework.AmplifyException import com.amplifyframework.annotations.InternalAmplifyApi import com.amplifyframework.auth.AuthUserAttributeKey import com.amplifyframework.core.configuration.AmplifyOutputsData.AmazonPinpointChannels -import com.amplifyframework.core.configuration.AmplifyOutputsData.Auth.AuthenticationFlowType import com.amplifyframework.core.configuration.AmplifyOutputsData.Auth.MfaConfiguration import com.amplifyframework.core.configuration.AmplifyOutputsData.Auth.MfaMethods import com.amplifyframework.core.configuration.AmplifyOutputsData.Auth.Oauth.IdentityProviders @@ -66,7 +65,6 @@ interface AmplifyOutputsData { @InternalAmplifyApi interface Auth { val awsRegion: String - val authenticationFlowType: AuthenticationFlowType val userPoolId: String val userPoolClientId: String val identityPoolId: String? @@ -114,9 +112,6 @@ interface AmplifyOutputsData { } } - @InternalAmplifyApi - enum class AuthenticationFlowType { USER_SRP_AUTH, CUSTOM_AUTH } - @InternalAmplifyApi @Serializable enum class UsernameAttributes { @@ -282,7 +277,6 @@ internal data class AmplifyOutputsDataImpl( @Serializable data class Auth( override val awsRegion: String, - override val authenticationFlowType: AuthenticationFlowType = AuthenticationFlowType.USER_SRP_AUTH, override val userPoolId: String, override val userPoolClientId: String, override val identityPoolId: String?, diff --git a/core/src/test/java/com/amplifyframework/core/configuration/AmplifyOutputsDataTest.kt b/core/src/test/java/com/amplifyframework/core/configuration/AmplifyOutputsDataTest.kt index 85c7e8338..17ee400ca 100644 --- a/core/src/test/java/com/amplifyframework/core/configuration/AmplifyOutputsDataTest.kt +++ b/core/src/test/java/com/amplifyframework/core/configuration/AmplifyOutputsDataTest.kt @@ -58,7 +58,6 @@ class AmplifyOutputsDataTest { val json = createJson( Keys.auth to mapOf( Keys.region to "us-east-1", - Keys.authFlowType to AmplifyOutputsData.Auth.AuthenticationFlowType.USER_SRP_AUTH.name, Keys.userPoolId to "user-pool", Keys.userPoolClientId to "user-pool-client", Keys.identityPoolId to "identity-pool", @@ -106,7 +105,6 @@ class AmplifyOutputsDataTest { outputs.auth.shouldNotBeNull() outputs.auth?.run { awsRegion shouldBe "us-east-1" - authenticationFlowType shouldBe AmplifyOutputsData.Auth.AuthenticationFlowType.USER_SRP_AUTH userPoolId shouldBe "user-pool" userPoolClientId shouldBe "user-pool-client" identityPoolId shouldBe "identity-pool" @@ -294,7 +292,6 @@ class AmplifyOutputsDataTest { // Auth const val auth = "auth" - const val authFlowType = "authentication_flow_type" const val userPoolId = "user_pool_id" const val userPoolClientId = "user_pool_client_id" const val identityPoolId = "identity_pool_id" diff --git a/testutils/src/main/java/com/amplifyframework/testutils/configuration/AmplifyOutputsDataBuilder.kt b/testutils/src/main/java/com/amplifyframework/testutils/configuration/AmplifyOutputsDataBuilder.kt index 745423f90..9dfef712f 100644 --- a/testutils/src/main/java/com/amplifyframework/testutils/configuration/AmplifyOutputsDataBuilder.kt +++ b/testutils/src/main/java/com/amplifyframework/testutils/configuration/AmplifyOutputsDataBuilder.kt @@ -72,8 +72,6 @@ class AmazonPinpointBuilder : AmplifyOutputsData.Analytics.AmazonPinpoint { class AuthBuilder : AmplifyOutputsData.Auth { override var awsRegion: String = "us-east-1" - override var authenticationFlowType: AmplifyOutputsData.Auth.AuthenticationFlowType = - AmplifyOutputsData.Auth.AuthenticationFlowType.USER_SRP_AUTH override var userPoolId: String = "user-pool-id" override var userPoolClientId: String = "user-pool-client-id" override var identityPoolId: String? = null