question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regenerating storage authentication token when it becomes stale

See original GitHub issue

Currently – 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:

  1. Detect that a token became stale and generate a new authentication token
  2. 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:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
markmhxcommented, Jan 22, 2019

This should be fixed by upgrading the version of blockstack.js used by the browser to the latest.

1reaction
kantaicommented, Jan 26, 2018

@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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found