On Jul 16, 2015, at 5:48 AM, Loïc LE PENN <loic....@gmail.com> wrote:Hi,I have an api loopback which work well with Strongloop Api Explorer.I try to make it work with a node proxy using module request. But when i try to login by the proxy i get the following error :{"error": {"name": "Error","status": 401,"message": "Authorization Required","statusCode": 401,"code": "AUTHORIZATION_REQUIRED","stack": "Error: Authorization Required\n at c:\\Users\\WFSZ8297\\Desktop\\VlanManager\\TEASeT-server\\node_modules\\loopback\\lib\\application.js:348:21\n at c:\\Users\\WFSZ8297\\Desktop\\VlanManager\\TEASeT-server\\node_modules\\loopback\\lib\\model.js:313:7\n at c:\\Users\\WFSZ8297\\Desktop\\VlanManager\\TEASeT-server\\node_modules\\loopback\\common\\models\\acl.js:465:23\n at c:\\Users\\WFSZ8297\\Desktop\\VlanManager\\TEASeT-server\\node_modules\\loopback\\node_modules\\async\\lib\\async.js:251:17\n at done (c:\\Users\\WFSZ8297\\Desktop\\VlanManager\\TEASeT-server\\node_modules\\loopback\\node_modules\\async\\lib\\async.js:132:19)\n at c:\\Users\\WFSZ8297\\Desktop\\VlanManager\\TEASeT-server\\node_modules\\loopback\\node_modules\\async\\lib\\async.js:32:16\n at c:\\Users\\WFSZ8297\\Desktop\\VlanManager\\TEASeT-server\\node_modules\\loopback\\node_modules\\async\\lib\\async.js:248:21\n at c:\\Users\\WFSZ8297\\Desktop\\VlanManager\\TEASeT-server\\node_modules\\loopback\\node_modules\\async\\lib\\async.js:572:34\n at c:\\Users\\WFSZ8297\\Desktop\\VlanManager\\TEASeT-server\\node_modules\\loopback\\common\\models\\acl.js:447:17\n at c:\\Users\\WFSZ8297\\Desktop\\VlanManager\\TEASeT-server\\node_modules\\loopback\\common\\models\\role.js:215:21"}}I use a model which override User model and use exactly the same acl as the build in model on login.proxy code :// Dépendancesvar http = require('http'),express = require('express'),app = express(),request = require('request');var host = 'localhost';var port = 3001;//app.use(express.cookieParser());app.post('/api/users/login', function (req, res) {console.log(req.headers);request({//headers:req.headerbody: req.body}, function(error, response, body){if (!error && response.statusCode == 200) {res.status(200).send();}else if(error){console.log(error);res.status(503).send();}else{console.log(response.body)res.status(response.statusCode).send(response.body);}});});/*app.post('/logout', function (req, res, next) {});app.all('/api/*', function (req, res, next) {});*/var server = app.listen(port,host, function () {console.log('Example app listening at http://%s:%s', host, port);});Savez vous comment résoudre ce problème ?Cordialement,Loïc Le PENN--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/922839f1-0812-4d91-8f4a-34b4e210ccac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.