Replies: 6 comments 4 replies
-
With the help of @nicolasg-playster I was able to resolve this issue. I have attached an example jwt junit test as an example of how to implement this. I have used this implementation to successfully embed an iframe in my current application while having the current user already logged into the wiki when they navigate to the page containing the iframe. Here is a snippet of how to get the decrypted private key from the pem cert created in setup.js. You can use that key to be able to sign a jwt that wikijs will be able to parse. Finally, you will obviously need to populate the
For the full example please see: |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
@fourgates @NGPixel : newbie question - Is the pem file mentioned here the same one used to configure SSL in config.yml ?
|
Beta Was this translation helpful? Give feedback.
-
i think in my case i used the same private key. i used the pfx format though (another ssl option) |
Beta Was this translation helpful? Give feedback.
-
@bwalsh They are not the same no. The key in your config.yml is for HTTPS purposes only. The key used to sign the JWT is stored in the database under the settings table. |
Beta Was this translation helpful? Give feedback.
-
I have the JWT decrypted using openssl:
I see a lot of code expecting the JWT token to be in a Cookie. Is there a good way to sign the JWT payload on another server and hand it off to the wiki? |
Beta Was this translation helpful? Give feedback.
-
Question
Since wiki.js uses JWT, I would like to like to utilize the JWT token in my current application to accomplish a single sign-on (SSO) experience. If a user is logged into the application, then the user should not have to log in again when accessing the wiki. I have a Spring Boot (Java) backend and I am having trouble signing the JWT, wikijs gives me forbidden errors when accessing the admin page. I have been referencing
server\models\users.j:refreshToken
to see how the token is signed. I was thrown off because it looks like the token is signed with both a private cert and a passphrase.Can you please give me guidance on how to sign my token?
Host Info
OS: [Windows]
Wiki.js version: [e.g. 2.0.0-beta.180]
Spring Version: 2.1.4.RELEASE (spring-boot-starter-parent)
Java Version: 8
Beta Was this translation helpful? Give feedback.
All reactions