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

Cannot keep Integration Connected

New post

Comments

7 comments

  • poolet08

    I would like to add that this seems to happen when many documents are transferred over during a period. Is there perhaps an API Limit that we are hitting?

    0
    Comment actions Permalink
  • jcleblanc

    Hi ,

     

    Could you share the error that you're getting when the connections start to fail? Based on what you've said my guess is that your access token is expiring. Tokens will only last for about an hour and then need to be refreshed. It could be that the token is expiring during the transfer period. 

     

    - Jon

    0
    Comment actions Permalink
  • poolet08

    Hi Jon,

     

    The error is: 

    Box.V2.Exceptions.BoxSessionInvalidatedException
     
    The integration seems to only come unlinked during the transfer of documents. 
    0
    Comment actions Permalink
  • jcleblanc

    Hi ,

     

    Take a look at these two threads on the issue to see if they might match your integration:

    0
    Comment actions Permalink
  • poolet08

    Hi Jon,

     

    //     An exception to represent that the current access/refresh tokens are in an unrecoverable
        //     state. This can either be due to the tokens being revoked or expired. A new session
        //     must be created by going through the OAuth workflow again
     
    So this seems to be the issue. 
    0
    Comment actions Permalink
  • iwilson91

    Hello,

    Thank you for the ideas  

    We are storing and supplying the AccessToken and RefreshToken as such:

    var auth = new OAuthSession(userProfile.BoxSettings.AccessToken, userProfile.BoxSettings.RefreshToken, userProfile.BoxSettings.ExpiresInSeconds, userProfile.BoxSettings.TokenType);

     

    We know this to be working because in our own testing, the connection stays linked for weeks now without issue, so certainly the token is refreshing.

     

    We have one client in particular who's connection will throw BoxSessionInvalidatedException.

     

    Is this the exception we should expect if the session is cleared from their Box.com site, and if so is there any way we can discern that this is what happened?

    If we are supplying the appropriate AccessToken and RefreshToken, in what scenarios can this exception still throw?

    Thank you,

    Ian

    0
    Comment actions Permalink
  • jcleblanc

    Hi ,

     

    Honestly as far as I know the token should not become invalidated from a user step, unless say the user access was locked down (account decommissioning). It doesn't look like folks are reporting any issues with the token services, so that appears to be working correctly. 

     

    I wish I could provide more here, but I would just suggest listening for those errors to be returned and force a manual refresh of the token when it does.

     

    - Jon

    0
    Comment actions Permalink

Please sign in to leave a comment.