Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add fields for refresh token and expiry timestamps #477

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

SebRollen
Copy link
Contributor

GitHub now supports expiring access tokens.

For these tokens, GitHub sends additional fields in the OAuth response, namely expires_in, refresh_token and refresh_token_expires_in. This pull request optionally adds these fields to the OAuth response struct so that they can be used by applications that are using expiring access tokens.

Comment on lines +114 to +116
expires_in: Option<usize>,
refresh_token: Option<String>,
refresh_token_expires_in: Option<usize>,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The size of expires_in and refresh_token_expires_in are currently fixed at 28800 and 15811200, respectively, so we could size down these fields to be Option<u16> and Option<u32>. I just copied the precedent for the Claims struct here

@XAMPPRocky
Copy link
Owner

Thank you for your PR!

@XAMPPRocky XAMPPRocky merged commit 06f2865 into XAMPPRocky:main Nov 3, 2023
10 checks passed
@github-actions github-actions bot mentioned this pull request Nov 3, 2023
@SebRollen SebRollen deleted the oauth-expiration branch November 6, 2023 15:39
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants