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

@sourceloop/authentication-service: Error: No factory found for sf.passport.strategyFactory.localPassword #2157

Open
Sumit9669 opened this issue Aug 16, 2024 · 3 comments

Comments

@Sumit9669
Copy link

Describe the bug
when using authentication service APIs to login getting following error:
Error: No factory found for sf.passport.strategyFactory.localPassword

API checked: auth/login(Error: No factory found for sf.passport.strategyFactory.localPassword)
auth/login-token(Error: No factory found for sf.passport.strategyFactory.ResourceOwner)

To Reproduce
Steps to reproduce the behavior:

  1. setup authentication microservice using sourceloop CLI.
  2. create user through migration or manual
  3. hit Login API

Expected behavior
user should be able to login successfully and it should return token to access to other resources

Screenshots
Capture254

Additional context
loopback cli: 6.0.0
sourceloop cli: 9.0.2
node:18.20.4
lerna 5.2.4

@yeshamavani
Copy link
Contributor

yeshamavani commented Aug 16, 2024

Hello @Sumit9669 the Local Passport strategy is not a mandatory strategy its an optional feature
so to use that you are required to bind the strategy to its provider. you can refer the docs here

@Sumit9669
Copy link
Author

@yeshamavani thanks for responding but i had tried this as well earlier but were getting same issue.

Apart from that in following scenario everything works fine:
sourceloop/cli: 4.2.0
node: 16.5
lerna : 5.4.2
authentication-service: v9.1.2

@yeshamavani
Copy link
Contributor

@yeshamavani thanks for responding but i had tried this as well earlier but were getting same issue.

Apart from that in following scenario everything works fine: sourceloop/cli: 4.2.0 node: 16.5 lerna : 5.4.2 authentication-service: v9.1.2

The strategy factory and its related binding needs to be provided after binding the component
Can you please confirm if you have done it that way.

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

No branches or pull requests

2 participants