loopback4-microservice-catalog icon indicating copy to clipboard operation
loopback4-microservice-catalog copied to clipboard

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

Open Sumit9669 opened this issue 1 year ago • 3 comments

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

Sumit9669 avatar Aug 16 '24 07:08 Sumit9669

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

yeshamavani avatar Aug 16 '24 10:08 yeshamavani

@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

Sumit9669 avatar Aug 17 '24 08:08 Sumit9669

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

yeshamavani avatar Aug 30 '24 07:08 yeshamavani

@Sumit9669 is it working for you

yeshamavani avatar Oct 29 '24 11:10 yeshamavani

it is resolved. After providing required binding.

prernagp avatar Nov 25 '24 12:11 prernagp

it is resolved. After providing required binding.

@prernagp @yeshamavani that time we were not able to solve it after providing binding, so we moved to lower version as we were on fast paced. For now you can close this issue, after updating dependencies if still breaks will re-open this issue.

Thanks a lot sourceloop team for assistance.

🙏

Sumit9669 avatar Nov 25 '24 13:11 Sumit9669