fix(generic): check local token expiry#1837
Conversation
|
I'd very much like to have any approach towards identifying local token expiration.
The last approach changing the API for the storage format (#1464) is now stale for almost a year. The |
b467d37 to
482a1ea
Compare
|
Some major caveat found while trying to prototype a "username@expiration" approach: Some storage back ends may also be thrown off by the changing username… Relative time in protocol additionally indicates this is to be used as a transient element. For now I'd definitely favor using structured token detection (transparent, backward-compatible, non-intrusive). |
482a1ea to
c8a7e32
Compare
e7d3dc2 to
d7e4f76
Compare
|
@mjcheetham @mpysson can you please take a look at this change? It's already been iterated upon. |
|
@mjcheetham @mpysson there've been no changes in this project for 5 months. Can I co-maintain it? Not sure if I can do it long term but I promise to go through the currently open pull requests at the very least. Better than nothing. |
|
any updates on this push? |
@itsjustnickdev cautiously: yes. I opened #2059. However, during the extended time of ownership limbo, Git Credential Manager's release process has withered to the point where no releases can be made as of time of writing (notarizing, for example, is broken, yet it is required for Git Credential Manager to work on macOS). Therefore, the primary concern right now is to get that release process into a healthy shape. If you want to look into #2059 in the meantime, that would be really cool, of course! |
mjcheetham
left a comment
There was a problem hiding this comment.
What do you think about the merits of using the JsonWebToken type from the https://www.nuget.org/packages/Microsoft.IdentityModel.JsonWebTokens package?
add decode support to Base64Url converter override GenericHostProvider credential query to check for token expiry add expiry check for refresh token add generic StructuredToken class with expiry status property add minimal JWT data classes for content decoding and extraction
d7e4f76 to
2efb138
Compare
|
@mjcheetham replaced handling of JWT with a generic StructuredToken placeholder. This should make expanding support (or replace implementation) fairly easily later on. |
|
If I know how this needs to be improved, I may have a chance to get it done in time for the next release. 😅 |
|
@mjcheetham I'd prefer to apply the (optional) switch to a "proper Identity library" at a later date. The update to In the current (revised) approach, changes to internal code should not require additional adjustments. |
|
@mjcheetham I'd prefer to apply the (optional) switch to a "proper Identity library" at a later date. The update to In the current (revised) approach, changes to internal code should not require additional adjustments. |
Not checking for expired tokens triggers failures on first fetch/push after expiration.
Many Oauth2 implementations use JWT, where expiration time stamp is stored in structured data.
Fixes #268
Fixes #1408
Fixes #1784