Skip to content

Commit 2b9128a

Browse files
authored
fix(auth): Updates to use fixed HostedUI (#734)
Updates Amplify to use the latest version of the SDK including the fixed version of HostedUI. In order to enable users to listen for the proper activity result, it also exposes the activity result code.
1 parent 30f98ed commit 2b9128a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

aws-auth-cognito/src/main/java/com/amplifyframework/auth/cognito/AWSCognitoAuthPlugin.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
import com.amazonaws.mobile.client.results.Tokens;
7474
import com.amazonaws.mobile.client.results.UserCodeDeliveryDetails;
7575
import com.amazonaws.mobile.config.AWSConfiguration;
76+
import com.amazonaws.mobileconnectors.cognitoauth.AuthClient;
7677
import com.amazonaws.mobileconnectors.cognitoidentityprovider.util.CognitoJWTParser;
7778
import com.amazonaws.services.cognitoidentity.model.NotAuthorizedException;
7879
import org.json.JSONException;
@@ -90,6 +91,13 @@
9091
* A Cognito implementation of the Auth Plugin.
9192
*/
9293
public final class AWSCognitoAuthPlugin extends AuthPlugin<AWSMobileClient> {
94+
/**
95+
* The result code for the activity manging the web UI sign in flow.
96+
* This is needed for handling the response in the onActivityResult method of your activity.
97+
* See the documentation for more information: https://docs.amplify.aws/lib/auth/signin_web_ui/q/platform/android
98+
*/
99+
public static final int WEB_UI_SIGN_IN_ACTIVITY_CODE = AuthClient.CUSTOM_TABS_ACTIVITY_CODE;
100+
93101
private static final String AWS_COGNITO_AUTH_PLUGIN_KEY = "awsCognitoAuthPlugin";
94102
private static final long SECONDS_BEFORE_TIMEOUT = 10;
95103
private static final String COGNITO_USER_ID_ATTRIBUTE = "sub";

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ ext {
5151
minSdkVersion = 16
5252
targetSdkVersion = 30
5353

54-
awsSdkVersion = '2.17.1'
54+
awsSdkVersion = '2.18.0'
5555
dependency = [
5656
android: [
5757
desugartools: 'com.android.tools:desugar_jdk_libs:1.0.9',

0 commit comments

Comments
 (0)