Tokens from classic OAuth App stop working after 8 hours #210540
Replies: 3 comments
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
Check for |
|
Hi @community! GitHub OAuth Apps configured with Token expiration issue user access tokens valid for 8 hours with an accompanying Fix: Implement Token RefreshWhen the token expires after 8 hours, use the refresh token to request a new access token: POST https://github.com/login/oauth/access_token
client_id: YOUR_CLIENT_ID
client_secret: YOUR_CLIENT_SECRET
grant_type: refresh_token
refresh_token: YOUR_REFRESH_TOKENThis issues a fresh 8-hour access token and rotated refresh token. |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
Apps
Body
User tokens issued by our organization’s OAuth App stop working about 8 hours after they are issued. Every API call with the token then returns
401 Bad credentials. It’s a classic OAuth App, not a GitHub App, used by the Mattermost GitHub plugin, with one connected user.The app’s settings have no token expiration option. Nobody revoked the tokens: the user’s security log shows no
oauth_authorization.destroy, password change or 2FA change. It does show anoauth_access.regenerateby “GitHub System” within a second of eachoauth_access.create. The same happens for an unrelated integration (Copilot), so we assume that is routine.Eight hours is the lifetime of expiring user tokens for GitHub Apps, so we suspect that expiry now also applies to classic OAuth Apps.
Our questions:
refresh_tokenwe should use?oauth_access.regenerateright after eachoauth_access.createexpected, and could it be what invalidates the token?We also reported this to the Mattermost plugin: mattermost/mattermost-plugin-github#1069
All reactions