User model, loopback-connector-rest External Authorization Service

34 views
Skip to first unread message

Damian Chojna

unread,
Aug 5, 2017, 5:49:52 PM8/5/17
to loopb...@googlegroups.com
How manage users and tokens, when I have another miscroservice AuthMicroService as REST API to get, create users and tokens. Users and tokens are stored in db managed by AuthMicroService.

In my case how login should work, example.

[Send login/pass from Browser] -> [loopback App] -> [AuthMicroService] -> [Db]
And AuthMicroService will return Token. 
 
With this token I can authorize user:
[Send token from Browser] -> [loopback App] -> [AuthMicroService] -> [Db]
And AuthMicroService will return User model.

I try do this with loopback-connector-rest as datastore attached to User model, but this connector doesn't support relations between models, so I removed relations, but it probably will not work properly authentications, also I have errors:

The model "CustomAccessToken" configures "belongsTo User-like models" relation with target model "User". However, the model "User" is not attached to the application and therefore cannot be used by this relation. This typically happens when the application has a custom custom User subclass, but does not fix AccessToken relations to use this new model.
Learn more at http://ibm.biz/setup-loopback-auth
The model "CustomUser" configures "hasMany AccessToken-like models" relation with target model "AccessToken". However, the model "AccessToken" is not attached to the application and therefore cannot be used by this relation. This typically happens when the application has a custom AccessToken subclass, but does not fix User relations to use this new model.
Learn more at http://ibm.biz/setup-loopback-auth

How to solve it or how can i do this in another way?
Reply all
Reply to author
Forward
0 new messages