Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions java/org/apache/catalina/authenticator/AuthenticatorBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ public AuthenticatorBase() {
*/
protected boolean alwaysUseSession = false;

/**
* Should we allow reauthentication from SSO? The original authentication (and the SSO session) may have been
* established via a weaker authentication mechanism.
*/
protected boolean allowSsoReauthentication = false;

/**
* Should we cache authenticated Principals if the request is part of an HTTP session?
*/
Expand Down Expand Up @@ -239,6 +245,14 @@ public void setAllowCorsPreflight(String allowCorsPreflight) {
this.allowCorsPreflight = AllowCorsPreflight.valueOf(allowCorsPreflight.trim().toUpperCase(Locale.ENGLISH));
}

public boolean getAllowSsoReauthentication() {
return allowSsoReauthentication;
}

public void setAllowSsoReauthentication(boolean allowSsoReauthentication) {
this.allowSsoReauthentication = allowSsoReauthentication;
}

public boolean getAlwaysUseSession() {
return alwaysUseSession;
}
Expand Down
20 changes: 14 additions & 6 deletions java/org/apache/catalina/authenticator/SSLAuthenticator.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ public class SSLAuthenticator extends AuthenticatorBase {

private final Log log = LogFactory.getLog(SSLAuthenticator.class); // must not be static

private boolean allowSsoReauthentication = false;

public boolean getAllowSsoReauthentication() {
return allowSsoReauthentication;
}

public void setAllowSsoReauthentication(boolean allowSsoReauthentication) {
this.allowSsoReauthentication = allowSsoReauthentication;
}


/**
* Authenticate the user by checking for the existence of a certificate chain, validating it against the trust
* manager for the connector and then validating the user's identity against the configured Realm.
Expand All @@ -64,12 +75,9 @@ protected boolean doAuthenticate(Request request, HttpServletResponse response)
// NOTE: We don't try to reauthenticate using any existing SSO session,
// because that will only work if the original authentication was
// BASIC or FORM, which are less secure than the CLIENT-CERT auth-type
// specified for this webapp
//
// Change to true below to allow previous FORM or BASIC authentications
// to authenticate users for this webapp
// TODO make this a configurable attribute (in SingleSignOn??)
if (checkForCachedAuthentication(request, response, false)) {
// specified for this webapp. This behaviour may be modified by setting
// the allowSsoReauthentication property.
if (checkForCachedAuthentication(request, response, allowSsoReauthentication)) {
return true;
}

Expand Down
12 changes: 12 additions & 0 deletions java/org/apache/catalina/authenticator/mbeans-descriptors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
description="Should a session always be used once a user is authenticated?"
type="boolean"/>

<attribute name="allowSsoReauthentication"
description="Should reauthentication from SSO be allowed?"
type="boolean"/>

<attribute name="cache"
description="Should we cache authenticated Principals if the request is part of an HTTP session?"
type="boolean"/>
Expand Down Expand Up @@ -80,6 +84,10 @@
description="Should a session always be used once a user is authenticated?"
type="boolean"/>

<attribute name="allowSsoReauthentication"
description="Should reauthentication from SSO be allowed?"
type="boolean"/>

<attribute name="cache"
description="Should we cache authenticated Principals if the request is part of an HTTP session?"
type="boolean"/>
Expand Down Expand Up @@ -254,6 +262,10 @@
group="Valve"
type="org.apache.catalina.authenticator.SSLAuthenticator">

<attribute name="allowSsoReauthentication"
description="Should reauthentication from SSO be allowed?"
type="boolean"/>

<attribute name="cache"
description="Should we cache authenticated Principals if the request is part of an HTTP session?"
type="boolean"/>
Expand Down