In my Angular-fullstack application:
{"id":"z2MgpdN2dyXHHWw2DLhAI026vHBgxw43jpCz9khWa7U9GykAmnQZAaeXV2nvEvQ8","ttl":1209600,"created":"2016-07-21T16:47:34.020Z","userId":"571609e4c88c6db26b75aacd"}
http://myrestservice.com:3000/api/Users/571609e4c88c6db26b75aacd?access_token=z2MgpdN2dyXHHWw2DLhAI026vHBgxw43jpCz9khWa7U9GykAmnQZAaeXV2nvEvQ8
The response was Error 401 AUTHORIZATION_REQUIREDQuestion!!: How can I configure StrongLoop to handle with multiple instances of the same server/server.js ? I read about to configure stored REDIS session, but the guides talks about Express + REDIS stored session management. I think this is a different approach.
Thanks in advance!
It seems you are not persisting your AccessTokens on a common dataSource for all your running servers/processes.
Try inspecting your model-config.json
file and verify the dataSource for the AccessToken model is shared.
This will probably NOT be shared between all your servers/processes:
"AccessToken": {
"dataSource": "memory",
"public": false
},
This WILL be shared between all your servers/processes:
"AccessToken": {
"dataSource": "mysqlDs",
"public": false
},
*Where mysqlDs is stored on MySQL
This is the relevant section of the Loopback docs to configuring datasources https://docs.strongloop.com/display/public/LB/Attaching+models+to+data+sources#Attachingmodelstodatasources-Makethemodelusethedatasource