Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension point for registering the authentication strategies #2312

Closed
6 tasks done
jannyHou opened this issue Jan 30, 2019 · 4 comments
Closed
6 tasks done

Extension point for registering the authentication strategies #2312

jannyHou opened this issue Jan 30, 2019 · 4 comments
Assignees

Comments

@jannyHou
Copy link
Contributor

jannyHou commented Jan 30, 2019

Description / Steps to reproduce / Feature proposal

Follow the extension pattern example to create extension point for registering multiple authentication strategies.

Background of the story:
Now we implement a new provider in a hardcoded way to perform the authenticate action of the custom jwt strategy created by ourselves, see custom authentication provider.
This should be an extensible point that people can plugin the actions for both passport and non passport-based strategies.

Acceptance Criteria

  • Create an extension point for authentication strategies
    • Decorate a strategy provider class AuthenticationStrategyProvider with @extensionPoint
    • The strategy provider class constructor should have a strategy getter decorated with @extensions
    • update the authentication action provider AuthenticateActionProvider to use AuthenticationStrategy interface and the new strategy provider class
    • Document how to implement & register an auth strategy. Can be light documentation since we already have some documentation discussing extension points and extensions.
  • Use "jwt" and "basic" strategies for tests. Not shipping production ready strategies.

See Reporting Issues for more tips on writing good issues

@jannyHou jannyHou changed the title Extension point for registering the custom authentication action Extension point for registering the non-passport based authentication strategies Feb 28, 2019
@bajtos
Copy link
Member

bajtos commented Mar 5, 2019

IMO, we should design the extension point for auth strategies in the following way:

  • The extension point is LoopBack specific, the strategy interface is defined to match the needs of LoopBack and custom LoopBack strategies.
  • To support Passport-based strategies, we should provide an adapter that will accept a Passport strategy and convert it into LB strategy (that will be part of Creating adapter for the plugged in passport strategies #2311 though).

@bajtos
Copy link
Member

bajtos commented Mar 5, 2019

I think this story depends on #2466: Add abstraction for authentication strategy.

@jannyHou
Copy link
Contributor Author

To support Passport-based strategies, we should provide an adapter that will accept a Passport strategy and convert it into LB strategy

Sounds good to me. There is already an adapter in @loopback/authenticate we can borrow.

@dhmlau dhmlau added the 2019Q2 label Mar 22, 2019
@jannyHou jannyHou changed the title Extension point for registering the non-passport based authentication strategies Extension point for registering the authentication strategies Mar 25, 2019
@emonddr emonddr modified the milestone: April 2019 milestone Apr 1, 2019
@dhmlau dhmlau mentioned this issue Apr 5, 2019
22 tasks
@dhmlau dhmlau added the p1 label Apr 10, 2019
@emonddr emonddr self-assigned this Apr 24, 2019
@dhmlau dhmlau added this to the May 2019 milestone milestone Apr 29, 2019
@dhmlau
Copy link
Member

dhmlau commented May 4, 2019

@emonddr , with your PR #2763 merged, does it mean this task is done? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants