diff --git a/CHANGELOG.md b/CHANGELOG.md index c4050d5cb7..ae923a0245 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## [Release 2.25.0](https://github.com/aws-amplify/aws-sdk-android/releases/tag/release_v2.25.0) + +### Features +- **aws-android-sdk-cognitoidentityprovider:** update models to latest (#2510) + +### Bug Fixes +- **aws-android-sdk-lex:** prioritize custom lex signer for all regions (#2506) +- **mobileclient:** Honor auth flow setting from config (#2499) +- **aws-android-sdk-polly:** use correct SignerConfig in all regions (#2505) + +[See all changes between 2.24.0 and 2.25.0](https://github.com/aws-amplify/aws-sdk-android/compare/release_v2.24.0...release_v2.25.0) + ## [Release 2.24.0](https://github.com/aws-amplify/aws-sdk-android/releases/tag/release_v2.24.0) ### Features diff --git a/aws-android-sdk-mobile-client/src/main/java/com/amazonaws/mobile/client/AWSMobileClient.java b/aws-android-sdk-mobile-client/src/main/java/com/amazonaws/mobile/client/AWSMobileClient.java index dda961d0f0..61e41d46dc 100644 --- a/aws-android-sdk-mobile-client/src/main/java/com/amazonaws/mobile/client/AWSMobileClient.java +++ b/aws-android-sdk-mobile-client/src/main/java/com/amazonaws/mobile/client/AWSMobileClient.java @@ -317,6 +317,13 @@ static SignInMode fromString(final String str) { */ boolean mIsPersistenceEnabled = true; + /** + * Flag that indicates if the SRP password verification is used in + * a custom authentication Flow. By default, this is set to false. + * If set to true custom authentication would be enabled. + */ + boolean mCustomAuthEnabled = true; + /** * Constructor invoked by getInstance. * @@ -492,7 +499,9 @@ public void run() { } mIsPersistenceEnabled = true; // Default value - // Read Persistence key from the awsconfiguration.json and set the flag + mCustomAuthEnabled = false; // Default value + + // Read Persistence key from the awsconfiguration.json and set the flags // appropriately. try { if (awsConfiguration.optJsonObject(AUTH_KEY) != null && @@ -501,6 +510,14 @@ public void run() { .optJsonObject(AUTH_KEY) .getBoolean("Persistence"); } + + if ( + awsConfiguration.optJsonObject(AUTH_KEY) != null && + awsConfiguration.optJsonObject(AUTH_KEY).has("authenticationFlowType") && + awsConfiguration.optJsonObject(AUTH_KEY).getString("authenticationFlowType").equals("CUSTOM_AUTH") + ) { + mCustomAuthEnabled = true; + } } catch (final Exception ex) { // If reading from awsconfiguration.json fails, invoke callback. callback.onError(new RuntimeException("Failed to initialize AWSMobileClient; please check your awsconfiguration.json", ex)); @@ -790,6 +807,12 @@ public void run() { } } + public boolean isCustomAuthEnabled() { return mCustomAuthEnabled; } + + public void setCustomAuthEnabled(boolean customAuthEnabled) { + mCustomAuthEnabled = customAuthEnabled; + } + /** * Uses Android system commands to determine if the device is online. * Requires ACCESS_NETWORK_STATE. @@ -1246,7 +1269,7 @@ public void getAuthenticationDetails(AuthenticationContinuation authenticationCo String authFlowType = authFlowTypeInConfig ? awsConfiguration.optJsonObject(AUTH_KEY).getString("authenticationFlowType") : null; - if (authFlowTypeInConfig && AUTH_TYPE_INIT_CUSTOM_AUTH.equals(authFlowType)) { + if (mCustomAuthEnabled) { // If there's a value in the config and it's CUSTOM_AUTH, we'll // use one of the below constructors depending on what's passed in. if (password != null) { diff --git a/gradle.properties b/gradle.properties index 61182ea880..7cb972aa9e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,7 +26,7 @@ android.enableJetifier=true GROUP=com.amazonaws -VERSION_NAME=2.24.0 +VERSION_NAME=2.25.0 POM_URL=https://github.com/aws/aws-sdk-android POM_SCM_URL=https://github.com/aws/aws-sdk-android