Jump to content

With spotfire 10.10, using javascript api to open a document with open id connect failed


Gabriel Dausque

Recommended Posts

Hello using OpenId for authentication with spotfire 10.10 using javascript Api for a mashup, I'm having trouble with authentication with the same code that is working for 10.3 :

with 10.3.6 when trying to open a document :

- If I'm not authenticate, the createlogin handler is called, the button to call the login window is created

- when clicking, authentication window appears

- when login is done, window is closing and the onReady handler is called

With 10.10 and openid :

- If I'm not authenticate, the createlogin handler is called, the button to call the login window is created

- when clicking, authentication window appears

- authentication is running with sso, BUT the login window stays on landing page and will never close until I close it manually

- the readyHandler is never called

The only way for me to have the document opening in 10.10 is to poll to see if the app object has been created, and if it is not, to retry to open the document.

Can you help with this issue

Link to comment
Share on other sites

Here is the only message I've received in the mashup window :

Failed to load resource: the server responded with a status of 401 () for this script : /spotfire/wp/js-api/initiate:1

Nothing in the login window, but as it is a Sso process, it is too fast for me to open the console window before the authentication process ...

My question is why after sso process the onReadyHandler is never called

Link to comment
Share on other sites

After debugging a little bit the loader.js, here is my understanding of the issue :

- during logging, process, loader.js wait for a window message to call the ending function :

function s(o, l) {

window.removeEventListener("message", f), C.parentNode.removeChild©, v && v.close(), m && m.parentNode.removeChild(m);

var p = document.createElement("script");

if (((p.type = "text/javascript"), p.appendChild(document.createTextNode(o)), document.head.appendChild(p), "function" == typeof spotfire.webPlayer.Application)) {

var d = new spotfire.webPlayer.Customization();

if (i) for (var h in i) d.hasOwnProperty(h) && (d[h] = i[h]);

a(l, new spotfire.webPlayer.Application(g + "/spotfire/wp/", d, c, r, n));

var s = t.shift();

s s() : (e = !1);

} else a({ status: "INTERNAL_ERROR", message: "JavaScript API does not contain a definition of 'spotfire.webPlayer.Application'." });

}which is in charge of calling the onready handler.

In my case, after authentication, no window message are sent from the authentication window to the caller window.

I think it is related to the fact that after authentication, I'm still on the landing page, which is quite surprising.

EDIT : It seems that the authentication process does not redirect us tohttps:///spotfire/js-api/proxy.html as it seems to do it in spotfire 10.3.X

Can you help on why the authentication process seems to act as if I have only opened the Spotfire web interface

In attachment you will find the simplest code example I've used to reproduce the issue. and also a small video showing the behavior

Link to comment
Share on other sites

Hello,

I have another information that is quite important for this issue :

The issue does'nt appears if THERE IS NO WHITE SPACE IN DOCUMENT PATH !!

Which is quite surprising. If I use a file with no white space in library path, the login process is working well.

I think this is a regression in spotfire code : as I already says, the login process is working fine in 10.3.6, but If I have white space in document path

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...