Canvas Log out


#1

Hi all

Is there a way to go automatically to the logon screen after a logout in Canvas ?
thanks


#2

The best option is SSO.

For Sydney Conference I created custom login page which saves user credentials utilizing $localStorage (Angularjs) or localStorage (javascript). So as only timeout happens, user will be redirected to a login page, where the first executed function would try to extract credentials from $localStorage. And if credentials is not null or undefined, it logs user back into application. User can close browser or even restart device, anyway he would be able to get back to app without re-entering credentials. It does look like SSO, but it’s not. This method is not secure, cause it saves credentials on a local machine. Also it doesn’t work in incognito mode, or if user clears a cache, he clears saved localStorage credentials as well. There are few other drawbacks of this method, but the lack of security is the main one.

I was thinking to create SSO for tm1userconference app, but I didn’t have much time for that during conference app development. And implementing SSO is not a quick and easy task). But I believe it’s doable.

If the question is just related to a short Canvas timeout, you may try to increase a standard 30 minutes timeout in WEB-INF/web.xml. <session-timeout>30</session-timeout>
HTTPSessionTimeoutMinutes needs be updated in tm1s.cfg as well.


#3

Canvas supports SSO:

But that doesn’t help @sschreurs if he’s not using Mode 5 security.

Jack


#4

True. I was talking about SSO without CAM.


#5

Hi Guys,

So how does canvas itself handle timeouts / re-logging in behind the scenes currently?
i.e. does it ping back to the tm1 server? Or how does it work exactly?
Have not have had time to do a deep dive into the backend and would prefer not having to code a log in from scratch as in this older feed here:

Thanks in advance,
Gerhard


#6

I wouldn’t suggest to rebuild login from scratch. if you just need to change how it looks, I believe it’s possible to do using css only. As per my understanding Canvas disconnect user from TM1 after timeout, but I might be wrong. So as for me updating timeout settings to some reasonable value can give optimal result with no codding.


#7

REST API sessions are set via HTTPSessionTimeoutMinutes in the TM1 config file.

Jack


#8

true. but it does look that settings is responsible for Canvas session. I guess generally the idea is to set up HTTPSessionTimeoutMinutes >= Canvas timeout.


#9

Hi guys,

Thanks all for your answer.
Just not sure to understand. I do not want to rebuild login screen or change login methodology. I just want that when I use the logout, it redirects to the login screen.
Now when I logoff, the windows stay open until a close it and by default the page I was using when I made the logoff remains open.


#10

you can create your own function and assign it to a button with ng-click:

        $tm1Ui.applicationLogout('yourTm1Instance').then(function(data){
             $state.go('home');
             //or
             // $window.location.reload();
         }

I thought the question was to log on automatically :cold_sweat: But really question was to go to log on screen automatically. Sorry!


#11

I’m not sure that helps @sschreurs either, Stephane aren’t you wanting Canvas to redirect back to your starting page if a user clicks “Logout” via the Canvas top right navbar?

Jack


#12

Redirection will trigger log on page. Refresh is second (commented) option to triger log on page. But true you need to put at least one tm1Ui directive on a home page. Alternatively you may call some TM1 data in home controller.


#13

Yes Jack, it’s what I want to do :+1:


#14

Hi Stephane,

I believe Canvas do not redirect/refresh a page because user can potentially use multiple instances/datasources and so he can be still connected and review a page and work on page even after he logs out from one instance. So I suggest to create your own button responsible for log out, untill or unless redirection option would be included in a new Canvas realese.

Regards,
Eugene


#15

Thanks Jack.
Gerhard