Tm1 Web login not working without timeout

canvas

#1

Dear Team,

We are trying to integrate TM1 web login into our application.I have used our canvas directive tm1-ui-web for this integration. it’s not working.I checked in the console network tab it showing error like “No token found for instance - c3” - 404 error. But it is working if I give timeout of 5000ms to reload the page in the login success.

Please find the reload code snippet below:

In tm1-ui-login directive I mentioned this “afterLoginInstance” function in tm1-after-login attribute.

afterLoginInstance(instance) {
     this.$timeout(() => {
        window.location.reload();
     }, 5000)
 }

Is there any best way to trigger the tm1 token API to resolve this issue without timeout?

I have also attached the screenshot.

Thanks in advance!

Prasanna R


#2

Hi @rprasanna,

Is there any error in the console? Or is there any other windows reload function aside from the above?

On login, if there are no other timeouts, another request would be fired off into the tm1web for its own authorization. The “No token found” usually is because the token did not reach Canvas when it replied. And this is usually because the page has been reloaded after the request for token has been fired, without the token being received yet.


Paul


#3

Hello @plim,

Thanks for the reply.

There is no error in the console. The page gets reloaded as soon as the login validate and it’s not giving time for the token request to get fired. So, because of this only canvas is not getting the token and we get the “No token found” in the response.

But if we use timeout function after the login the token request gets trigged and the token saved on the canvas.In this case, Tm1-web is working fine. So instead of timeout function is there any event to trigger the token request?

Thanks
Prasanna R


#4

Hi @rprasanna,

To answer about the any other way to trigger the token timeout, there is direct way or a function to trigger that. It is just a separate thread / process that gets triggered once a successful login is detected.

We will have a look into how to optimize the tm1-ui-web. There is a recent version of TM1 already where it can share the same session between TM1 server and the TM1 web. That should help on this scenario as it will not need to fire a separate request to tm1web already on login.

So in the meantime, what you have is a good alternative. You can lower the timeout, depending on how fast tm1web respond with the token that Canvas need to interact with the tm1web on its component.

Let us know if you need further clarification.


Paul