diff options
author | Jesse McConnell | 2012-05-24 13:35:22 +0000 |
---|---|---|
committer | Jesse McConnell | 2012-05-24 13:35:22 +0000 |
commit | cf214ffeef0397bafe7ec2c542779c4f15f200ff (patch) | |
tree | fa005d89624707034dc71ae9f5f4bc4d0a51c013 /jetty-security/src/main/java/org/eclipse/jetty/security/authentication | |
parent | c7a9adaa323fc8ec2042021115dc4d2499e86424 (diff) | |
parent | c8fe38733fc65c9d7ef6090338d77b3075e82b82 (diff) | |
download | org.eclipse.jetty.project-cf214ffeef0397bafe7ec2c542779c4f15f200ff.tar.gz org.eclipse.jetty.project-cf214ffeef0397bafe7ec2c542779c4f15f200ff.tar.xz org.eclipse.jetty.project-cf214ffeef0397bafe7ec2c542779c4f15f200ff.zip |
Merge branch 'master' into jetty-8
Diffstat (limited to 'jetty-security/src/main/java/org/eclipse/jetty/security/authentication')
-rw-r--r-- | jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java index c21768fde1..dcd91498f3 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java @@ -77,6 +77,7 @@ public class FormAuthenticator extends LoginAuthenticator private String _formLoginPage; private String _formLoginPath; private boolean _dispatch; + private boolean _alwaysSaveUri; public FormAuthenticator() { @@ -95,6 +96,26 @@ public class FormAuthenticator extends LoginAuthenticator /* ------------------------------------------------------------ */ /** + * If true, uris that cause a redirect to a login page will always + * be remembered. If false, only the first uri that leads to a login + * page redirect is remembered. + * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=379909 + * @param alwaysSave + */ + public void setAlwaysSaveUri (boolean alwaysSave) + { + _alwaysSaveUri = alwaysSave; + } + + + /* ------------------------------------------------------------ */ + public boolean getAlwaysSaveUri () + { + return _alwaysSaveUri; + } + + /* ------------------------------------------------------------ */ + /** * @see org.eclipse.jetty.security.authentication.LoginAuthenticator#setConfiguration(org.eclipse.jetty.security.Authenticator.AuthConfiguration) */ @Override @@ -279,9 +300,9 @@ public class FormAuthenticator extends LoginAuthenticator // remember the current URI synchronized (session) { - // But only if it is not set already - if (session.getAttribute(__J_URI)==null) - { + // But only if it is not set already, or we save every uri that leads to a login form redirect + if (session.getAttribute(__J_URI)==null || _alwaysSaveUri) + { StringBuffer buf = request.getRequestURL(); if (request.getQueryString() != null) buf.append("?").append(request.getQueryString()); |