Hi,
There are two ways you can authenticate against KNIME Server REST API endpoints: JWT and Basic authentication .
I want to get KNIME Session.
REST API EndPoint is ’ http://{knime_server}/knime/rest/v4/auth/session’
I tried to authenticate using JWT. The response value contains only cookie information.
The header does not contain Set-Cookie information.
Even though the session was created, this cookie doesn’t work properly.
When I try to authenticate using Basic Auth, there are cookie information in the response value and Set-Cookie information in the header.
Please refer to the picture below.
The session is created by the Tomcat application server. JWT authentication is something we added to Tomcat which bypasses certain parts of the Tomcat authentication. Therefore Tomcat cannot create a session when using JWT authentication, only when you provide you username and password using BASIC auth.
Then, how can I use the cookie (JSSESSIONID) in respones when I requested the REST API using JWT authentication?
It’s created in Tomcat, but I can’t use it. Is there really no way?
Tomcat creates sessions in a two-step process. First an anonymous session is created. Then you have to provide username and password and this anonymous session and in return you get an authenticated session. This doesn’t work without providing both username and password and therefore it won’t work with JWT.
The question is more: if you already have a JWT why do you need a session?