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

Error occurs when getting the access token from the auth code only for the first access of the day

Answered
New post

Comments

3 comments

  • anoland

    Hi  

     

    Can you verify that you are passing a request with the content-type set to application/x-www-form-urlencoded? 

    If you aren't already, that change should address the issues you are seeing. If you continue to see this issue, I may have follow up questions 🙂 

    0
    Comment actions Permalink
  • 西山泰正

    Thank you, .

    The request content type is set to application/x-www-form-urlencoded.

     

    Another thing I'm curious about is that the first time I access it every day, it takes a lot of time for my web application screen to appear.

     

    1. Select Box integration menu
    2. Access my web application (receive authorization code)
    3. Access token acquisition error (The authorization code has expired)

     

    2-3 is about 10 to 20 seconds.
    1 to 3 is about 70 to 80 seconds or more.

     

    No error occurs when you access it a second time. At this time, it takes about 10 seconds.

    0
    Comment actions Permalink
  • 西山泰正

    Thank you, everyone.

     

    I understand why only the first access results in an error.

     

    When the web application was accessed for the first time from Box integration, it took a very long time to start the web application from IIS and display the screen.
    Therefore, it took more than 60 seconds from Box issuing the authorization code to requesting the access token from the web application.

    Authentication code is valid for 60 seconds

     

    The development environment shuts down the virtual machine every day and starts it in the morning, but it seems that the initial access took time at that time.
    I don't think this problem occurs in a production environment as the machine will always boot.

     

    Thank you.

    0
    Comment actions Permalink

Please sign in to leave a comment.