Skip to content
Deva Kumar edited this page Apr 27, 2022 · 4 revisions

Logout

This feature allows Viya applications to support logout option. On logout the user is given the option to log back on - just as any SAS Viya session allows the user to do.

SAS Logon Manager has an allowed URIs configuration. This a comma-delimited list of URIs that users can be redirected to after signing in following a time-out or logoff. SAS application URIs and registered client redirect URIs are automatically included in the list.

Use SAS Environment Manager to set this in SAS Logon Manager configuration. An example is

http://localhost:8080/viyaapp

The application's Logout code should like as shown below.

<button id="logout" onclick="logout()">Logout </button>

The logout function will look like this

  function logout() {
           let url = `${window.location.protocol}//${window.location.host}/${appName}/logout`;
           window.location.replace(url);
       }

See the documentation on appenv route on how to get the value of appName.

This will invoke the logout route in viya-appserverjs. At the end of the processing the user will be given an option to re logon on or exit.

Clone this wiki locally