connectycube-web-samples icon indicating copy to clipboard operation
connectycube-web-samples copied to clipboard

Bad Authentication data - 200 - POST /session

Open dozsolti opened this issue 3 years ago • 12 comments

Hello,

I've made a POST to https://api.connectycube.com/session

{
 "application_id": my application id from dashboard,
 "auth_key": my auth key from dashboard,
 "nonce": generated with Math.floor(Math.random() * 10000),
 "timestamp": generated with Math.floor(Date.now() / 1000),
 "user":{
    "login": here some email,
    "password": here some password
 },
 "signature": generated by concating all the properties above and then HmacSha1 with my auth secret
}

But I've got status 200 OK with this message:

{
    "errors": [
        "Bad Authentication data. Unauthorized on remote side. Status: 401.Response \"{\\n  \\\"name\\\": \\\"UnauthorizedError\\\",\\n  \\\"message\\\": \\\"No authorization token was found\\\",\\n  \\\"stack\\\": \\\"UnauthorizedError: No authorization token was found\\\\n    at middleware (/usr/src/app/node_modules/express-jwt/lib/index.js:76:21)\\\\n    at module.exports (/usr/src/app/api/policies/isAuthenticated.js:38:4)\\\\n \""
    ]
}

dozsolti avatar Feb 09 '21 10:02 dozsolti