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

Error callback in Hosted UI function not getting proper error message from Lambda function #2255

Closed
shishir87 opened this issue Nov 23, 2020 · 1 comment
Assignees
Labels
cognito Issues with the AWS Android SDK for Cognito improvement Improvements and suggestions from community mobile client Issues with AWS Mobile's client-side Cognito wrapper

Comments

@shishir87
Copy link

shishir87 commented Nov 23, 2020

AWS Cognoto Hosted UI

Is your feature request related to a problem? Please describe.
Hi,
I am developing an Android app that has login with Google and Facebook options. To achieve this I am using below line of code using Kotlin language.

val hostedUi = HostedUIOptions.builder()
    .scopes("openid", "email")
    .identityProvider("Facebook") // here it can be "Google" for login with google
    .build()
val signInUIOptions = SignInUIOptions.builder()
    .hostedUIOptions(hostedUi)
    .build()
AWSMobileClient.getInstance()
    .showSignIn(requireActivity(), signInUIOptions, object : Callback<UserStateDetails> {
        override fun onResult(details: UserStateDetails) {
        }
        override fun onError(e: Exception) {
            Log.e(TAG, "onError: ", e)    //   [1] I should get the lambda exception here 
        }
    }
)

Our backend developer has written a lambda trigger to check whether the same email Id is already present in database when user sign up and if it does, then it throws an error with error_description = "PreSign up failed with error An account with the given email already exists".

Now my problem is, I am not getting this "error_description" message in onError callback method. (refer [1] in kotlin code given above).
Instead, I get AuthServiceException with message "invalid_request". I want the exact same "error_description" that lambda is throwing.
Please help to solve my problem.

Thanks,
Shishir Pednekar

@richardmcclellan richardmcclellan added mobile client Issues with AWS Mobile's client-side Cognito wrapper cognito Issues with the AWS Android SDK for Cognito question General question labels Nov 24, 2020
@richardmcclellan richardmcclellan added feature-request Request a new feature and removed question General question labels Jul 21, 2021
@eeatonaws eeatonaws self-assigned this Sep 9, 2022
@eeatonaws eeatonaws added improvement Improvements and suggestions from community and removed feature-request Request a new feature labels Sep 9, 2022
@eeatonaws
Copy link
Contributor

A fix for the issue has been released in version 2.53.0 of the AWS SDK for Android.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cognito Issues with the AWS Android SDK for Cognito improvement Improvements and suggestions from community mobile client Issues with AWS Mobile's client-side Cognito wrapper
Projects
None yet
Development

No branches or pull requests

3 participants