multi-tenancy example with JWT authentication error #10154
Unanswered
dmacchiavello
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I have been working on the Loopback-based project example "examples/multi-tenancy" and I managed to connect to different SqlServer databases successfully.
When I add jwt authentication provided by loopback in "How to secure your LoopBack 4 application with JWT authentication",
application.ts
// ------ ADD SNIPPET AT THE BOTTOM ---------
// Mount authentication system
this.component(AuthenticationComponent);
// Mount jwt component
this.component(JWTAuthenticationComponent);
// Bind datasource
this.dataSource(DbDataSource, UserServiceBindings.DATASOURCE_NAME);
this.dataSource(DbDataSource, RefreshTokenServiceBindings.DATASOURCE_NAME);
// ------------- END OF SNIPPET -------------
Server is running at http://[::1]:3000
Try http://[::1]:3000/ping
Connection fails: TypeError: The "config.server" property is required and must be of type string.
It will be retried for the next request.
/home/daniel/Documents/dev/jscript/multi-tenancy-ds8/node_modules/tedious/lib/connection.js:121
throw new TypeError('The "config.server" property is required and must be of type string.');
^
TypeError: The "config.server" property is required and must be of type string.
Beta Was this translation helpful? Give feedback.
All reactions