Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

How to solve session time out problem for the integrated apps?

I am doing some activity and after certain time its force us to refresh.Our integrated app need this session time out to be soved 

Answers

  • mbattistellombattistello Member, Developers Posts: 51 ✭✭
    I believe you need your app to be able to detect the timeout and then use the refresh token to get a new one. The session tokens are purposely set to expire and then use the refresh token to get a new one. If you use one of the prebuilt Oauth packages then they often handle this automatically. 
  • awkawk Member, Onshape Employees, Developers Posts: 78
    Can you be a little more specific about the timeout that is occurring. Are you referring to the expiration time of the OAuth token ? Or an inactivity timeout that is present and associated with the web socket used for part studio and assembly communication with the server (the timeout on this socket is quite lengthy, a user would have to be using your just your app for a long period - the Client Side Messaging documentation in the Developer Portal also covers a way to keep this connection active if required).

    As Marc mentioned OAuth tokens need to be refreshed approximately every 60 minutes, the OAuth documentation in the Developer Portal covers the refresh process, some OAuth packages take care of all (or a lot) of the work required to refresh a token. So depending on your environment you may need to do a certain amount of work to refresh an OAuth token if an API call fails and then retry the API Call with the new & refreshed token.
    Director of API, Appstore, and App Partner Technical Support
Sign In or Register to comment.