auth0/auth0-java

Auth0 Sign up request

priyasharma1 opened this issue · 6 comments

Description

When the entered password does not meet the required format set in the connection, an exception is thrown.

I am using Auth0-1.4.0.jar and Java 1.8

Reproduction

  1. Try creating a user with password as 12345,
    since by default, the password policy is
  • Special characters (!@#$%^&*)
  • Lower case (a-z), upper case (A-Z) and numbers (0-9)
  • Must have 8 characters in length
  • Non-empty password required

An error should be returned as shown in the recorded logs on Auth0.

But instead I am receiving an exception -

 [java] java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to java.lang.String
 [java] 	at com.auth0.exception.APIException.obtainExceptionMessage(APIException.java:77) ~[auth0-1.4.0.jar:?]
 [java] 	at com.auth0.exception.APIException.<init>(APIException.java:32) ~[auth0-1.4.0.jar:?]
 [java] 	at com.auth0.net.CustomRequest.createResponseException(CustomRequest.java:104) ~[auth0-1.4.0.jar:?]
 [java] 	at com.auth0.net.CustomRequest.parseResponse(CustomRequest.java:57) ~[auth0-1.4.0.jar:?]
 [java] 	at com.auth0.net.BaseRequest.execute(BaseRequest.java:37) ~[auth0-1.4.0.jar:?]
 [java] 	at com.hotwax.auth0.Auth0Events.signUp(Auth0Events.java:178) ~[auth0.jar:?]

Please verify and let me know if I need to amend something at my end.

👋 this was fixed on 1.5.0. Try using the latest version!

Thanks @lbalmaceda
I did try using Auth0-1.5.0.jar but still facing the same issue.

[java] java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to java.lang.String
 [java] 	at com.auth0.exception.APIException.obtainExceptionMessage(APIException.java:77) ~[auth0-1.5.0%20.jar:?]
 [java] 	at com.auth0.exception.APIException.<init>(APIException.java:32) ~[auth0-1.5.0%20.jar:?]
 [java] 	at com.auth0.net.CustomRequest.createResponseException(CustomRequest.java:104) ~[auth0-1.5.0%20.jar:?]
 [java] 	at com.auth0.net.CustomRequest.parseResponse(CustomRequest.java:57) ~[auth0-1.5.0%20.jar:?]
 [java] 	at com.auth0.net.BaseRequest.execute(BaseRequest.java:37) ~[auth0-1.5.0%20.jar:?]
 [java] 	at com.hotwax.auth0.Auth0Events.signUp(Auth0Events.java:178) ~[auth0.jar:?]

Additionally, here are the other libraries being used, please let me know if any of these needs to be updated as well.
auth0-lib

Sorry I meant 1.5.1. Why don't you use the last version? That one you want to use is like an year old. Also, the next time you can check the changelog and stay up to date with the features/fixes.

Thanks @lbalmaceda that worked. Hence I am closing the ticket.

Sure, we will update to the latest version.

P.S. Do we need to keep the jars updated regularly?

Is not necessary, but we continuously add features and fix bugs. You can stay up to date checking the changelog. We follow semver.. there's no harm on using the last version. Cheers