Start a new topic

Unable to create new user

I am unable to create user through java.I am getting following exception.


com.kinvey.java.core.KinveyJsonResponseException: unknown

 at com.kinvey.java.core.KinveyJsonResponseException.from(KinveyJsonResponseException.java:102)

 at com.kinvey.java.auth.KinveyAuthRequest.executeUnparsed(KinveyAuthRequest.java:218)

 at com.kinvey.java.auth.KinveyAuthRequest.execute(KinveyAuthRequest.java:222)

 at com.kinvey.java.User$LoginRequest.execute(User.java:769)

 at com.kinvey.UserService.main(UserService.java:23)



My code is:

final Client mKinveyClient = new Client.Builder(appKey, appSecret).build();

         

        try {

    Boolean pingResult = mKinveyClient.ping();

     System.out.println("Client ping result -> " + pingResult);

       mKinveyClient.user().loginBlocking(appKey, masterSecret).execute();

         System.out.println("Auth Token-->" +mKinveyClient.user().getAuthToken());

     mKinveyClient.user().logout().execute();

    User result = mKinveyClient.user().createBlocking("ram@test.com", "Test@123").execute();

                 }    

        catch (IOException e){

           System.out.println("Couldn't login -> " + e.getMessage());

           e.printStackTrace();

       }


Thank you for your reply.Actual issue with business logic.Now I am using appSecret only for services.

Thank you Aniruddha Wani.Actual issue with business logic.Now iam using appSecret key only for client side code.

Hi,


Can you tell me what you are trying to do in your code? Can you tell me on which line you are getting the error? I see three distinct steps in above code- ping, login with master secret & logout and user signup.


Also, using master secret in your client side code/app logic is strongly discouraged.



Regards,

Wani

Kinvey Support

Login or Signup to post a comment