Regenerating storage authentication token when it becomes stale
See original GitHub issueCurrently – gaia hub authentication tokens use a ‘date’ timestamp during authentication. Our default provider will mod
arithmetic this timestamp to simulate a validity time. Of course, this means that storage connections in blockstack browser can become stale.
The application will see this as a ‘401’ unauthenticated write when they try to PUT a file to the hub – users will experience a silent error when updating their profile.
This can be remedied for a user by loading:
http://localhost:8888/account/storage#gaiahub
However, blockstack browser should be able to either:
- Detect that a token became stale and generate a new authentication token
- Generate the token at the time of write, on each write
(2) will be a 1 round-trip slower, but has the benefit of reducing state
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Refresh Tokens - OAuth 2.0 Simplified
The presence of the refresh token means that the access token will expire and you'll be able to get a new one without...
Read more >Acquire and cache tokens with Microsoft Authentication ...
You can also clear the token cache, which is achieved by removing the accounts from the cache. This doesn't remove the session cookie...
Read more >Understanding Refresh Tokens - Auth0
When access tokens expire or become invalid but the application still needs to access a protected resource, the application faces the problem of...
Read more >Token expiration and revocation - GitHub Docs
When a token has expired or has been revoked, it can no longer be used to authenticate Git and API requests. It is...
Read more >Invalidating JSON Web Tokens - Stack Overflow
This is the correct answer. The data store lookup is only required when clients request new stateless access token (to validate the refresh...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This should be fixed by upgrading the version of blockstack.js used by the browser to the latest.
@benoror reported experiencing this issue (and I think a number of other users have run into it as well).
The smart-profile-writes update actually sort of mitigates this issue, by generating a token when the profile updates (however, writing to old profile locations (i.e., /root-address/x/profile.json) still tries to use the global token).