Sandor Molnar created KNOX-3615:
-----------------------------------

             Summary: KnoxSSO logout page "Sign in again" button always opens 
the form-based login page, breaking login for federated (pac4j/SAML) topologies
                 Key: KNOX-3615
                 URL: https://issues.apache.org/jira/browse/KNOX-3615
             Project: Apache Knox
          Issue Type: Bug
          Components: KnoxSSO
            Reporter: Sandor Molnar


h3. Problem
KNOX-3505 added a "Sign in again" button to the KnoxSSO logout page 
({{knoxauth/logout.jsp}}). The button is a form with a hard-coded 
{{action="login.html"}}, so it always opens the form-based (ShiroProvider) 
login page, whatever authentication provider the topology uses.

When the KnoxSSO topology authenticates via the pac4j federation provider (e.g. 
SAML2Client), the login form cannot work: {{login.html}} posts Basic 
credentials to {{../api/v1/websso}}, but that endpoint only accepts the pac4j 
flow. The login fails with an HTTP 403 ("Response from 
.../api/v1/websso?originalUrl=... - 403").

h3. Steps to reproduce
# Configure a KnoxSSO topology with the pac4j federation provider (SAML2Client) 
and the {{knoxauth}} application. A ShiroProvider block may also be present 
with {{<enabled>false</enabled>}}.
# Log in through KnoxSSO, then log out so that 
{{knoxauth/logout.jsp?originalUrl=<app URL>}} is shown.
# Click "Sign in again".

*Expected:* the user is sent to the configured IdP to log in.
*Actual:* the form-based login page is shown, and submitting it fails with HTTP 
403.

"Return to application" on the same page works with every provider: it 
redirects to {{originalUrl}}, which leads back to {{api/v1/websso}}, and the 
active provider takes over (ShiroProvider redirects to {{login.html}} via 
{{redirectToUrl}}, pac4j redirects to the IdP).

h3. Proposed fix
Remove the "Sign in again" button from {{logout.jsp}} and update the page text 
accordingly, so that "Return to application" is the single action. This 
restores the pre-KNOX-3505 behaviour and works for both form-based and 
federated topologies.

An alternative is to keep the button and point it at {{../api/v1/websso}} 
(passing the same {{originalUrl}} and {{theme}} params) instead of 
{{login.html}}, but that duplicates what "Return to application" already does.




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to