Search code examples
authenticationloopbackjsbuilt-in

Loopback 4: Extend the built in User model


I am migrating from Loopback 3 to 4.

The question is what do I do with my user model that was extended from the built-in User model. I tried to play with the model generator: lb4 model [options] [<name>] But there are no built-in models available as far as I can see.

I saw an example in the documentation where a user model was defined without a base model.

  • Is this the way to go?
  • How do I use the built-in user features like Login etc.?

Solution

  • According to https://loopback.io/doc/en/lb4/Understanding-the-differences.html#conceptfeature-mapping : Built-in models are only marked as TBD (To Be Developped?)...

    Hope more is coming in an early future because I personally see no interest in migrating if the User model is not supported yet.


    April 2019 Edit:

    Not exactly a Built-in model, but the Loopback team added a reference implementation using JWT authentication in this github project shopping example.

    They also worked on a more detailed design and started the implementation to enable extension points for plugging in different authentication strategies.


    July 2019 Edit:

    The authentication component has been refactored and the full documentation is available here: https://loopback.io/doc/en/lb4/Loopback-component-authentication.html