Skip to content

Commit 3466509

Browse files
authored
feat(auth): Adds improved HostedUI functionality (#739)
1 parent 106be3c commit 3466509

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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

Lines changed: 7 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,12 @@
9091
* A Cognito implementation of the Auth Plugin.
9192
*/
9293
public final class AWSCognitoAuthPlugin extends AuthPlugin<AWSMobileClient> {
94+
/**
95+
* The code which the web UI activity is launched under and is needed to listen to the result.
96+
* See the documentation for more information: https://docs.amplify.aws/lib/auth/signin_web_ui/q/platform/android
97+
*/
98+
public static final int WEB_UI_SIGN_IN_ACTIVITY_CODE = AuthClient.CUSTOM_TABS_ACTIVITY_CODE;
99+
93100
private static final String AWS_COGNITO_AUTH_PLUGIN_KEY = "awsCognitoAuthPlugin";
94101
private static final long SECONDS_BEFORE_TIMEOUT = 10;
95102
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)