[Rt-commit] rt branch, 4.6/rt-logout-link-config, created. rt-4.6.0-pre1-1-g20b67e74c7

Maureen Mirville maureen at bestpractical.com
Wed Jan 2 10:36:26 EST 2019


The branch, 4.6/rt-logout-link-config has been created
        at  20b67e74c786b3aa7d198734eb9f09799b4627ef (commit)

- Log -----------------------------------------------------------------
commit 20b67e74c786b3aa7d198734eb9f09799b4627ef
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date:   Fri Dec 28 23:23:45 2018 -0500

    Make RT logout link configurable
    
    When external authentication is used to log into RT, the RT logout
    link needs to be updated to direct to the identity provider's
    logout URL, rather than the default RT logout link. Config added to
    make it easier to update the logout URL.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index f6e7273f04..cac2c5a391 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2470,6 +2470,17 @@ chance of fallback to the login screen, even if REMOTE_USER failed.
 
 Set($WebFallbackToRTLogin, undef);
 
+=item C<$LogoutURL>
+
+By default, C<$LogoutURL> is set to RT's logout page. When an
+external service is used to log into RT, C<$LogoutURL> must be set
+to the identity provider's logout URL. The URL must also include
+the link's full path, for example: 'https://www.example.com'.
+
+=cut
+
+Set($LogoutURL, '/NoAuth/Logout.html');
+
 =item C<$WebRemoteUserGecos>
 
 C<$WebRemoteUserGecos> means to match 'gecos' field as the user
diff --git a/lib/RT/Interface/Web/MenuBuilder.pm b/lib/RT/Interface/Web/MenuBuilder.pm
index 283aeee9bd..4d407d3653 100644
--- a/lib/RT/Interface/Web/MenuBuilder.pm
+++ b/lib/RT/Interface/Web/MenuBuilder.pm
@@ -272,10 +272,11 @@ sub BuildMainNav {
 
         }
     }
+    my $logout_url = RT->Config->Get('LogoutURL');
     if ( $current_user->Name
          && (   !RT->Config->Get('WebRemoteUserAuth')
               || RT->Config->Get('WebFallbackToRTLogin') )) {
-        $about_me->child( logout => title => loc('Logout'), path => '/NoAuth/Logout.html' );
+        $about_me->child( logout => title => loc('Logout'), path => $logout_url );
     }
     if ( $request_path =~ m{^/Dashboards/(\d+)?}) {
         if ( my $id = ( $1 || $HTML::Mason::Commands::DECODED_ARGS->{'id'} ) ) {
@@ -1246,10 +1247,11 @@ sub BuildSelfServiceNav {
         $about_me->child( prefs => title => loc('Preferences'), path => '/SelfService/Prefs.html' );
     }
 
+    my $logout_url = RT->Config->Get('LogoutURL');
     if ( $current_user->Name
          && (   !RT->Config->Get('WebRemoteUserAuth')
               || RT->Config->Get('WebFallbackToRTLogin') )) {
-        $about_me->child( logout => title => loc('Logout'), path => '/NoAuth/Logout.html' );
+        $about_me->child( logout => title => loc('Logout'), path => $logout_url );
     }
 
     if ($current_user->HasRight( Right => 'ShowArticle', Object => RT->System )) {

-----------------------------------------------------------------------


More information about the rt-commit mailing list