AWSMobileClient signUp action for new users is not allowed when no app client secret is configured userpool
State your question When sign up a new user to no appclient secret configured userpool, i get the exception snippets below.
App client secret is allowed in Android sdk, but the
CognitoUserPool(Context context, AWSConfiguration awsConfiguration) constructor read key AppClientSecret will always opt with empty string if AppClientSecret not set in configuration.json.
Which AWS Services are you utilizing?
com.amazonaws.mobile.client.AWSMobileClient
Provide code snippets (if applicable)
11-21 17:40:43.568 24637-26276/com.softchef.androidlab D/LoginFragment$onActivit: java.lang.IllegalArgumentException: key.length == 0
at javax.crypto.spec.SecretKeySpec.<init>(SecretKeySpec.java:62)
at com.amazonaws.mobileconnectors.cognitoidentityprovider.util.CognitoSecretHash.getSecretHash(CognitoSecretHash.java:57)
at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool.signUpInternal(CognitoUserPool.java:416)
at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool.signUp(CognitoUserPool.java:378)
at com.amazonaws.mobile.client.AWSMobileClient$7.run(AWSMobileClient.java:1093)
at com.amazonaws.mobile.client.internal.InternalCallback$1.run(InternalCallback.java:101)
at java.lang.Thread.run(Thread.java:818)
And i manual setup the aws configuration.json file with:
{
"IdentityManager": {
"Default": {}
},
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": "ap-southeast-1:xxxxxxxxxxxxxxxxxxxxx",
"Region": "ap-southeast-1"
}
}
},
"CognitoUserPool": {
"Default": {
"PoolId": "ap-southeast-1_xxxxxxx",
"AppClientId": "xxxxxxxxxxx",
"Region": "ap-southeast-1"
}
}
}
Environment(please complete the following information):
- SDK Version: 2.8.2
Device Information (please complete the following information):
- Device: Samsung Note 4
- Android Version: 6.0.1
- Specific to simulators:
If you need help with understanding how to implement something in particular then we suggest that you first look into our developer guide. You can also simplify your process of creating an application, as well as the associated backend setup by using the Amplify CLI.
Hi @scdplzop ,
Thanks for pointing out the issue. We are looking at it and aiming to resolve this in a future release with pull request #593
Hi @scdplzop ,
We have released a fix in version 2.8.5 of the SDK. Please see if this fixes the issue for you.
Hi @minbi , After migrate to 2.8.5, the exception mentioned above gone, and now without providing client secret in awsconfuguration.json works. Thanks to anyone working on this issue.
Excellent, thanks for confirming.