-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT]: Support refreshtokens in OAuth flow #2731
Labels
Type: Feature
New feature or request
Comments
if the proposal is accepted, I'll gladly implement it :) |
@Kencdk that seems reasonable to me! PRs are always appreciated. |
Kencdk
added a commit
to Kencdk/octokit.net
that referenced
this issue
Jul 18, 2023
Kencdk
added a commit
to Kencdk/octokit.net
that referenced
this issue
Jul 18, 2023
kfcampbell
added a commit
that referenced
this issue
Jul 27, 2023
* Support refreshtokens in OAuth flow Fixes #2731 * Added summary to OauthToken.cs constructors * Mark deprecation of non-refreshToken constructor for OauthToken * Remove unnecessary comment --------- Co-authored-by: Keegan Campbell <me@kfcampbell.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the need
While the library currently supports getting access tokens from an OAuth callback, the resulting object doesn't include the refresh token, which allows an application to get a new access token for the user, without having to go through the entire OAuth flow again.
Additionally, the OAuthClient doesn't support a way to get an access token from a refresh token.
The refresh token is returned in the original request to get an access token.
https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app
https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/refreshing-user-access-tokens
Proposal:
Add RefreshToken as a property on Octokit/Models/Response/OauthToken.cs
Add RefreshToken as a property on Octokit/Models/Request/OauthTokenRequest.cs
If a OauthTokenRequest contains a RefreshToken but the AuthToken is null only the refresh_token property should be added to the request body due to the null check in RequestParameters.cs::ToParametersDictionary()
SDK Version
No response
API Version
No response
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: