Znuny 6.5.11 LTS here with Apache Mellon as SSO module (IDP is RedHat SSO/Keycloak).
I'm having an issue when a user is not logged and is trying to reach a specific page (let's say AgentTicketZoom to read a ticket for instance).
Once SSO is done, Znuny does not redirect to the right page but at the homepage.
Let's break it down:
1. Agent opens:
Code: Select all
GET https://ZNUNY/otrs/index.pl?Action=AgentTicketZoom;TicketID=2944977
Code: Select all
GET https://ZNUNY/otrs/index.pl?Action=PreLogin&RequestedURL=Action=AgentTicketZoom;TicketID=2944977
Code: Select all
POST https://ZNUNY/otrs/index.pl
Code: Select all
"Action": "Login",
"RequestedURL": "Action=AgentTicketZoom;TicketID=2944977"
Code: Select all
GET https://ZNUNY/sso/login?ReturnTo=/otrs/index.pl?Reason=LoginFailed&RequestedURL=Action%3DAgentTicketZoom%3BTicketID%3D2944977
Code: Select all
GET https://IDP/auth/realms/REALM/protocol/saml?SAMLRequest=<payload>
Code: Select all
RelayState: /otrs/index.pl?Reason=LoginFailed
7. IDP now redirects to
Code: Select all
POST https://ZNUNY/sso/postResponse
Code: Select all
RelayState: /otrs/index.pl?Reason=LoginFailed
Code: Select all
GET https://ZNUNY/otrs/index.pl?Reason=LoginFailed
My question is: why is Znuny returning the "Reason=LoginFailed" and how can I force the good redirection after SSO?
Thank you very much for your help.
Additional informations:
/opt/otrs/Kernel/Config.pm
Code: Select all
$Self->{'AuthModule'} = 'Kernel::System::Auth::HTTPBasicAuth';
$Self->{'AuthModule1'} = 'Kernel::System::Auth::LDAP';
$Self->{'LoginURL'} = '/sso/login?ReturnTo=/otrs/index.pl';
$Self->{'LogoutURL'} = '/sso/logout?ReturnTo=/';
Code: Select all
SetEnv MELLON_DISABLE_SAMESITE 1
# Global Mellon configuration.
<Location />
MellonEnable info
MellonEndpointPath /sso
MellonSPPrivateKeyFile /etc/apache2/mellon/client-private-key.pem
MellonSPCertFile /etc/apache2/mellon/client-cert.pem
MellonSPMetadataFile /etc/apache2/mellon/sp-metadata.xml
MellonIdPMetadataFile /etc/apache2/mellon/idp-metadata.xml
#MellonMergeEnvVars On
MellonUser NAME_ID
MellonSetEnvNoPrefix REMOTE_USER NAME_ID
</Location>
# Guard web interface only.
<Location /(znuny|otrs)/index.pl>
AuthType Mellon
MellonEnable auth
Require valid-user
MellonPostReplay On
MellonSecureCookie On
MellonDefaultLoginPath "/otrs/index.pl"
MellonCookieSameSite none
</Location>