Welcome to Knowage Q&A, where you can ask questions and receive answers from other members of the community.
0 votes
1 view
Hi,

I want to embed knowage cockpit in an external webpage/application.

Authenticate sdk function is failing with https in chrome browser either using CORS or JSONP.

Is single-sign-on mandatory in order to do that over https?

What other options do we have in order to login before calling for a document?

Thanks
Environment knowage 7.4.3,
in API and SDK by (3.2k points)

3 Answers

0 votes
 
Best answer

I finally got this working. It was in fact a cookie problem.
Chrome, Edge and other modern browsers, default samesite property to "lax" (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite#cookies_without_samesite_default_to_samesitelax)
so the jsessionid cookie was lost during sdk authentication except for firefox.

Solution was to edit META-INF/context.xml and add: 

<CookieProcessor sameSiteCookies="none" />

Of course CorsFilters also need to be properly configured in WEB-INF/web.xml

This work without SSO needed.

by (3.2k points)
+1 vote

Dear rlagarde,

you can use the "embed in html functionality" you can find in documents toolbar instead of using the sdk.

If you need to embed public analysis you can configure the document so it is executable from a public role.
If the analysis are private, it's better if you set a SSO between your application and Knowage.

Regards

by (11.3k points)
Thank you for the kind answer.
Analysis are private indeed and use parametrical datasets.

I tried explaining the environnement there:
https://www.knowage-suite.com/qa/6093/documents-are-not-working-after-switching-to-https?show=6131#c6131

Since the sdk authenticate function doesn't seem to work in chrome over https,
Is there another way to login the user ?

EDIT: will try to set SSO and see if it helps.
Hello,

as an extreme option try to call the document execution url in POST passing the "USERNAME" and "PASSWORD" request parameters.

Hello redjaw,
I tried  passing credential in POST url but got the following:

"Silent login failed. If the problems persists, contact the system administrator."

So I am installing CAS SSO to make https call with knowageSDK.
But I hit another issue:
https://pastebin.com/aGkah71c

It seems issued JWT is incorrect.

Do you have any ideas what could be wrong here ?

thank you

@redjaw in case it helps,
It seems that sso is hitting the same issue that was mentionned here: https://github.com/KnowageLabs/Knowage-Server/issues/175
0 votes
Hi

I'm still trying to display a cockpit using https.
I just found out that the authenticateByToken SDK call seems to work on all browser when given a valid token.
Is there a way to get that token beforehand using any API call?

Also the problem with authenticate method appears to be that the CORS request is redirected 302 (knowage login page) and that is not handled well in most browsers.

I would really appreciate any help on that matter.

Regards
by (3.2k points)
...