julianlam / nodebb-plugin-session-sharing

Allows login sessions from your app to persist in NodeBB
MIT License
88 stars 65 forks source link

[session-sharing] Error encountered while parsing token: invalid signature #80

Closed avrAhituv closed 5 years ago

avrAhituv commented 5 years ago

Hello! I installed your extension, And I get an error: [session-sharing] Error encountered while parsing token: invalid signature

But my token is legal. And in the settings of the plugin I give it the right secret

julianlam commented 5 years ago

Test your payload on jwt.io, perhaps the secret in ACP has a space or something?

julianlam commented 5 years ago

Hi there -- sorry, I received no picture :point_up:

avrAhituv commented 5 years ago

token-valid.png

error.png

avrAhituv commented 5 years ago

Another thing What should be defined in Base Name? Where do I find the appId

julianlam commented 5 years ago

You can leave all values blank except the secret. If using defaults, then the cookie token will be looked for. The base name default is appId, you can leave it blank.

I do not know what to suggest as there have been no other reports of session sharing not working. Please double-check the cookie value and name, and ensure that the config matches what is presented to the server.

avrAhituv commented 5 years ago

Yes. Everything fits! I do not know what to do..

avrAhituv commented 5 years ago

The id attribute I pass in a cookie Is the user ID of my app, not in the forum. yes?

julianlam commented 5 years ago

Yes, that should be right. Can you send me a picture of your dev tools showing the cookie and its contents?

avrAhituv commented 5 years ago

Sorry. My mistake was with the code that created the token. The server is write by C# and i read secret from string by Convert.FromBase64String( Secret); But that function had to be used: Encoding.UTF8.GetBytes(Secret);

Now everything works fine!! Thank you and sorry..

avrAhituv commented 5 years ago

Another question: Does it create a password when a new user is created? If so, what is the password?