Skip to content

Core being called unnecessarily post signing key rotation #136

@rishabhpoddar

Description

@rishabhpoddar

Problem:

  • Let's say we have access tokens A1 signed with key K1, and A2 signed with key K2. K2's issue date > K1's issue date
  • Right now, K1 is known to the node SDK
  • if the user uses A2, it will fail verification, and go to the core. The core will return K2 which will be saved in the SDK.
  • Then if the user uses A1, it will fail (cause it will not work with K2). This will also go to the core which will return TRY_REFRESH_TOKEN error. This is unnecessary.

Solution:

  • When deciding if we should query the core due to session verification failure, we should check if the access token was generated before or after the public key being checked against. If it's before, then we should query the core (it means there is a newer public key). If it's after (means this is an access token signed by an older public key), then we should simply return TRY_REFRESH_TOKEN and not query the core.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions