Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWSMobileClient signUp action for new users is not allowed when no app client secret is configured userpool #587

Closed
suandplzop opened this issue Nov 21, 2018 · 4 comments
Assignees
Labels
bug Something isn't working cognito Issues with the AWS Android SDK for Cognito mobile client Issues with AWS Mobile's client-side Cognito wrapper pending-community-response Issue is pending response from the issue requestor

Comments

@suandplzop
Copy link

suandplzop commented Nov 21, 2018

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.

@minbi minbi self-assigned this Nov 21, 2018
@minbi minbi added the cognito Issues with the AWS Android SDK for Cognito label Nov 21, 2018
@frankmuellr frankmuellr added question General question bug Something isn't working and removed question General question labels Nov 21, 2018
@minbi minbi changed the title AWSMobileClient signUp new user not allowed to no app client secret configured userpool AWSMobileClient signUp action for new users is not allowed when no app client secret is configured userpool Nov 21, 2018
@mutablealligator mutablealligator added the mobile client Issues with AWS Mobile's client-side Cognito wrapper label Nov 26, 2018
@minbi minbi added the pending-release Code has been merged but pending release label Dec 5, 2018
@minbi
Copy link
Contributor

minbi commented Dec 5, 2018

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

@minbi
Copy link
Contributor

minbi commented Dec 6, 2018

Hi @scdplzop ,

We have released a fix in version 2.8.5 of the SDK. Please see if this fixes the issue for you.

@minbi minbi added pending-community-response Issue is pending response from the issue requestor and removed pending-release Code has been merged but pending release labels Dec 6, 2018
@suandplzop
Copy link
Author

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.

@frankmuellr
Copy link

Excellent, thanks for confirming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cognito Issues with the AWS Android SDK for Cognito mobile client Issues with AWS Mobile's client-side Cognito wrapper pending-community-response Issue is pending response from the issue requestor
Projects
None yet
Development

No branches or pull requests

4 participants