auth0 / Auth0.Android

Android toolkit for Auth0 API
https://auth0.com
MIT License
208 stars 129 forks source link

Change Password (User) #700

Closed AravinthNagaraj closed 7 months ago

AravinthNagaraj commented 7 months ago

Checklist

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

poovamraj commented 7 months ago

@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?

poovamraj commented 7 months ago

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

AravinthNagaraj commented 7 months ago

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

AravinthNagaraj commented 7 months ago

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

AravinthNagaraj commented 7 months ago

@poovamraj Did you get chance to check this ?

AravinthNagaraj commented 7 months ago

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

            }
        })
poovamraj commented 7 months ago

@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