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 e70216fc4..d52badb07 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 @@ -151,8 +151,7 @@ data class AuthConfiguration internal constructor( OauthConfiguration( appClient = auth.userPoolClientId, appSecret = null, // Not supported in Gen2 - // Use the custom domain if specified, otherwise use the generated cognito domain - domain = it.customDomain ?: it.cognitoDomain, + domain = it.domain, scopes = it.scopes.toSet(), // Note: Gen2 config gives an array for these values, while Gen1 is just a String. In Gen1 // if you specify multiple URIs the CLI will join them to a comma-delimited string in the json. 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 cb97711b9..915e7af2b 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 @@ -185,7 +185,7 @@ class AuthConfigurationTest { requireSymbols = true } oauth { - cognitoDomain = "https://test.com" + domain = "https://test.com" identityProviders += AmplifyOutputsData.Auth.Oauth.IdentityProviders.GOOGLE scopes += listOf("myScope", "myScope2") redirectSignInUri += "https://test.com/signin" @@ -259,22 +259,6 @@ class AuthConfigurationTest { configuration.identityPool.shouldBeNull() } - @Test - fun `uses custom oauth domain if specified`() { - val data = amplifyOutputsData { - auth { - oauth { - cognitoDomain = "cognito" - customDomain = "custom" - } - } - } - - val configuration = AuthConfiguration.from(data) - - configuration.oauth?.domain shouldBe "custom" - } - @Test fun `throws exception if auth is not configured in amplify outputs`() { val data = amplifyOutputsData { 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 630a51034..0dae51b79 100644 --- a/core/src/main/java/com/amplifyframework/core/configuration/AmplifyOutputsData.kt +++ b/core/src/main/java/com/amplifyframework/core/configuration/AmplifyOutputsData.kt @@ -89,8 +89,7 @@ interface AmplifyOutputsData { @InternalAmplifyApi interface Oauth { val identityProviders: List - val cognitoDomain: String - val customDomain: String? + val domain: String val scopes: List val redirectSignInUri: List val redirectSignOutUri: List @@ -301,8 +300,7 @@ internal data class AmplifyOutputsDataImpl( @Serializable data class Oauth( override val identityProviders: List, - override val cognitoDomain: String, - override val customDomain: String?, + override val domain: String, override val scopes: List, override val redirectSignInUri: List, override val redirectSignOutUri: List, 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 9dfef712f..eada856d3 100644 --- a/testutils/src/main/java/com/amplifyframework/testutils/configuration/AmplifyOutputsDataBuilder.kt +++ b/testutils/src/main/java/com/amplifyframework/testutils/configuration/AmplifyOutputsDataBuilder.kt @@ -103,8 +103,7 @@ class PasswordPolicyBuilder : AmplifyOutputsData.Auth.PasswordPolicy { class OauthBuilder : AmplifyOutputsData.Auth.Oauth { override val identityProviders: MutableList = mutableListOf() - override var cognitoDomain: String = "domain" - override var customDomain: String? = null + override var domain: String = "domain" override val scopes: MutableList = mutableListOf() override val redirectSignInUri: MutableList = mutableListOf() override val redirectSignOutUri: MutableList = mutableListOf()