As you’re using onAuthorized, it looks like you’re attempting to do this on the client side? You can’t create tokens client side as that would mean exposing your secret which would be a huge security breach.
You should only be creating tokens on your EBS, and the user_id in the JWT isn’t “the userId from before”, it’s the id of the extension owner.
As you’re using onAuthorized , it looks like you’re attempting to do this on the client side? You can’t create tokens client side as that would mean exposing your secret which would be a huge security breach.
Yes, I am. Thank you very much.
You should only be creating tokens on your EBS, and the user_id in the JWT isn’t “the userId from before”, it’s the id of the extension owner.
I am the extension owner, shouldn’t the id from before be the same one, in this case in particular at least?
Even if It wouldn’t work for other cases
Edit: Does the API know the message coming from the front end?
Technically speaking if you correctly create a token the request would still work if made from the front end, but there’s no point trying as like I said previously it would be a security breach and your extension can’t be approved as you would even by violating your Developer Agreement by exposing your secret.
Thank you, get-users worked and my id is the same as my channel id.
Still is it really not possible to do a test of sending a message to myself from the front end?
is that not possible?
I need to hire somebody to help me getting started. (if you are willing please send me private message)
New edit: I am using postman now to make the request, using the proper client_id and still get
{
“error”: “Forbidden”,
“status”: 403,
“message”: “Error (403): JWT could not be verified”
}
new edit 2: I am verifying my token here http://jwt.io and it returns verified. Could it be that my channel is not live? I don’t know what to think anymore
Thank you. I think the problem is how I am encoding the secret. I generated the jwt token in http://www.jwt.io and with that it works.
For testing purposes I will leave it like that for now since the next messages will have to be sent from the EBS, so for now I don’t worry anymore
I tried that example before but I don’t know which library you use for jwt.sign so I installed https://www.npmjs.com/package/jwt-simple and it said “Uncaught TypeError: _jwtSimple2.default.sign is not a function” so for now I will leave it with it working with the token from that link, I hope the backend works better.
The thing is that it was in fact the problem in the token, and not some other issue that was returning the same error, so I can rest for now.