Support refreshtokens in OAuth flow#2749
Conversation
e4d132c to
0c2025b
Compare
kfcampbell
left a comment
There was a problem hiding this comment.
This approach seems reasonable and I love the functionality!
| this.ErrorUri = errorUri; | ||
| } | ||
|
|
||
| public OauthToken(string tokenType, string accessToken, int expiresIn, string refreshToken, int refreshTokenExpiresIn, IReadOnlyList<string> scope, string error, string errorDescription, string errorUri) |
There was a problem hiding this comment.
Do you think it'd be worthwhile to add a comment here and above describing the situations when you'd want to use each constructor?
There was a problem hiding this comment.
I primarily kept the old one, to keep the change binary compatible - to avoid breaking changes :)
Added a summary for good measure.
These constructors aren't really meant to be used manually - so wondering if the one without the refresh token should be marked as deprecated, so it can be removed sometime in the future? :)
There was a problem hiding this comment.
Got it, thank you! I think it's reasonable to mark the old one as deprecated to be removed in a future major release. After that's done, I can merge and release this!
|
@Kencdk are you okay with the updates I've made? If so, I can ship this! |
@kfcampbell, Yup, looks good to me! |
Resolves #2731
Behavior
Before the change?
After the change?
Other information
While the endpoint is the same for creating an access token from a response code and for creating an access token based on the refresh token, there are key differences in the expected parameters. When creating based on a refresh token, the grant_type needs to be set.
As a result, I opted to create a new function instead of adding a mix of optional and required parameters (depending on input) to the existing CreateAccessToken function. Please advise if you'd prefer otherwise.
Additional info
Added <inheritdoc /> instead of having the xml doc in both interfaces and implementation.
The end-result is the same, it just avoids having to keep both up-to-date.
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!
Type: Breaking changelabel)If
Yes, what's the impact:Pull request type
Type: Feature