Welcome to the new Box Support website. Check out all the details here on what’s changed.

Error parsing private key for Box Developer Edition

Answered
New post

Comments

7 comments

  • kendomen

    did you put the jce files in java/jre/lib/security?

     

    http://stackoverflow.com/questions/6481627/java-security-illegal-key-size-or-default-parameters

     

    0
    Comment actions Permalink
  • cperumalla-dev

    Thank you for the quick help.

     

    I tried with the JCE but didn't work, with the link you provided I realised that i need to use JCE from IBM since I am using the IBM JRE for running.When I use the IBM JCE files it worked.

     

    Thanks

    Chandra

    0
    Comment actions Permalink
  • cperumalla-dev

    Hi Ken,

     

    Now i am getting the below exception when it tries to authenticate.

     

    com.box.sdk.BoxAPIException: The API returned an error code: 400
    at com.box.sdk.BoxAPIResponse.(BoxAPIResponse.java:70)
    at com.box.sdk.BoxJSONResponse.(BoxJSONResponse.java:30)
    at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:423)
    at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:209)
    at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:184)
    at com.box.sdk.BoxDeveloperEditionAPIConnection.authenticate(BoxDeveloperEditionAPIConnection.java:245)

     

    I have set the required scope in for my box application. I am using the enterprise account to connect to.

     

    Please help me wher could be the mistake.

    Thanks

    Chandra

    0
    Comment actions Permalink
  • kendomen

    Yes I got this error too.

     

    If you set a breakpoint in your code and drill down, you can capture what goes across the wire.  I captured the call and put it in postman and ran it and got the real error.

     

    The solution was 's https://community.box.com/t5/Developer-Forum/Current-date-time-MUST-be-before-the-expiration-date-time-listed/m-p/17929#M392

    0
    Comment actions Permalink
  • cperumalla-dev

    Hi Ken,

     

    Thanks for the solution, After troubleshooting with the postman, this is the response from the /token endpoint

    This app is not authorized by the enterprise admin.

    I am not able to see authorise button for this app, when I locate the app in admin console.

     

    Please advise, how to authorize the app.

     

    Thanks

    Chandra

    0
    Comment actions Permalink
  • kendomen

    Yes, you're right.

     

    The enterprise admin has to go to admin console -> enterprise settings -> apps -> Authorize App.

     

    I don't think there's any way around this but to talk to your admin.

    0
    Comment actions Permalink
  • shashijais789

    I also got the same error when I tried with Postman

    Request

    URL: https://api.box.com/oauth2/token

    Method: POST

    Body: grant_type, client_id, client_secret, assertion

     

    Response: 400 Bad Request

    {
    "error": "invalid_grant",
    "error_description": "Current date/time MUST be before the expiration date/time listed in the 'exp' claim"
    }

    0
    Comment actions Permalink

Please sign in to leave a comment.