auth0/Auth0.Android

Change Password (User)

AravinthNagaraj opened this issue · 7 comments

Checklist

  • I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Describe the problem you'd like to have solved

From Native Android I need to reset the password of user
I tried by passing email and db connection id which was correct one, but still am getting failure call back.
An error occurred when trying to authenticate with the server.

Sample mail id - test@gmail.com
Dummy connection ID - testDBID
auth0Configuration.authenticationApiClient.resetPassword("test@gmail.com", "testDBID")
.start(object : Callback<Void?, AuthenticationException> {
override fun onSuccess(result: Void?) {
// Handle successful password reset
// 'result' is null in this case
Log.e("resetPassword","result")
}
override fun onFailure(error: AuthenticationException) {
// Handle password reset failure
// 'error' contains information about the failure
Log.e("resetPassword",error.message.toString())
}
}) }

Describe the ideal solution

I need to get success or need valid reason or exceptions

Alternatives and current workarounds

No response

Additional context

No response

@AravinthNagaraj does the testDBID exist in Auth0. Please check here on how Databases work in Auth0.

Also, can you share what error message you received?

@AravinthNagaraj were you able to check the resources I shared above?

@poovamraj Sorry for the delay , Will share you in few mins.

@poovamraj
The error message is :
An error occurred when trying to authenticate with the server.

@poovamraj Did you get chance to check this ?

Hello, @poovamraj I attempted to change the connection id to the connection name, and now it's get success , but the result was null

Could you please tell me what will happen next or what I need to do to reset the password ?

    auth0Configuration.authenticationApiClient.resetPassword("example@gmail.com", "Username-Authentication")
        .start(object : Callback<Void?, AuthenticationException> {
            override fun onSuccess(result: Void?) {
          **result is null** 
            }
            override fun onFailure(error: AuthenticationException) {
                // Handle password reset failure
                // 'error' contains information about the failure
                
            }
        })

@AravinthNagaraj yes this would mean the password reset has succeeded. Please refer to the documentation here to understand the password reset work flow - https://auth0.com/docs/authenticate/database-connections/password-change.

We will close this issue as this doesn't seem to be an issue in the SDK. Please feel free to reach out at https://community.auth0.com/ if you have any questions on the product