Skip to content

Commit 3650360

Browse files
NischalManandharminbi
authored andcommitted
Update CognitoSecretHash.java
While creating CognitoUserPool instance using the awsConfiguration.json file with following description. "CognitoUserPool": { "Default": { "PoolId": "xxxxxxxxxx", "AppClientId": "xxxxxxxx", "AppClientSecret": "", "Region": "xxxx" } } It will return appClientSecret as "" which is not checked in this file and cause crash in android application.
1 parent adaffb1 commit 3650360

File tree

1 file changed

+3
-2
lines changed
  • aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/mobileconnectors/cognitoidentityprovider/util

1 file changed

+3
-2
lines changed

aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/mobileconnectors/cognitoidentityprovider/util/CognitoSecretHash.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ public static String getSecretHash(String userId, String clientId, String client
4949
throw new CognitoParameterInvalidException("client ID cannot be null");
5050
}
5151

52-
// Return null as secret hash if clientSecret is null.
53-
if (clientSecret == null) {
52+
// Return null as secret hash if clientSecret is null or "".
53+
// We receive clientSecret as "" if we create cognitoUserPool from awsConfiguration file with "AppClientSecret": "
54+
if (TextUtils.isEmpty(clientSecret)) {
5455
return null;
5556
}
5657

0 commit comments

Comments
 (0)