Loopback-next: Add refresh in the jwt extension

Created on 21 Apr 2020  路  6Comments  路  Source: strongloop/loopback-next

Suggestion

Based on the comment from @mschnee in https://github.com/strongloop/loopback-next/pull/5046#issuecomment-611778032.

Add token refresh functionality in the jwt auth extension https://github.com/strongloop/loopback-next/tree/master/extensions/authentication-jwt

There is a demo PR for token refresh in strongloop/loopback4-example-shopping#537, and the token service interface has revokeToken function added in https://github.com/strongloop/loopback-next/pull/4746/files.

Use Cases

TBD

_I may need more time to create the use case and example, cc @mschnee would you like to add your expected use cases here? Thank you!_

Examples

TBD

Acceptance criteria

  • [ ] Add refresh function in the jwt strategy and corresponding tests.
Authentication community-contribution feature help wanted

Most helpful comment

Closing as done as PR #5589 has landed.
Thanks @madaky and @jannyHou!

All 6 comments

@madaky, per our discussion on Slack, seems like you'll try to work on that. Assigning this to you now. Thanks!

@dhmlau: I am on it

Proposed Use Case for Referesh Token: Any sugestion @jannyHou @deepakrkris @dhmlau @mschnee

proposerefresh

cc @madaky There is some discussion in https://github.com/strongloop/loopback-next/issues/4573, I need a bit more time to investigate, will get back to you asap

The discussion #4573 : pointing towards adding a method signature in Authentication Component.

For giving User choice between Choosing need for refresh token. I implemented two interceptors
`
@intercept('refresh-token-generate') //to generate refresh token

@intercept('refresh-token-grant') // to refresh token
`
Will finish and pull it later today

Closing as done as PR #5589 has landed.
Thanks @madaky and @jannyHou!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rexliu0715 picture rexliu0715  路  3Comments

shahulhameedp picture shahulhameedp  路  3Comments

ThePinger picture ThePinger  路  3Comments

shadyanwar picture shadyanwar  路  3Comments

kesavkolla picture kesavkolla  路  3Comments