The UserLoginForm did not redirect after a successful SSO Login
git-svn-id: https://svn.libreccm.org/ccm/trunk@6222 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
7837170b4a
commit
83e586ab37
|
|
@ -127,8 +127,8 @@ public class SecurityConfig extends AbstractConfig {
|
||||||
"Register:com.arsdigita.kernel.security.CookieLoginModule:optional",
|
"Register:com.arsdigita.kernel.security.CookieLoginModule:optional",
|
||||||
"RegisterSSO:com.arsdigita.kernel.security.SimpleSSOLoginModule:requisite",
|
"RegisterSSO:com.arsdigita.kernel.security.SimpleSSOLoginModule:requisite",
|
||||||
"RegisterSSO:com.arsdigita.kernel.security.CookieLoginModule:optional",
|
"RegisterSSO:com.arsdigita.kernel.security.CookieLoginModule:optional",
|
||||||
"RegisterSAML:com.arsdigita.kernel.security.SamlLoginModule:requisite",
|
// "RegisterSAML:com.arsdigita.kernel.security.SamlLoginModule:requisite",
|
||||||
"RegisterSAML:com.arsdigita.kernel.security.CookieLoginModule:optional"
|
// "RegisterSAML:com.arsdigita.kernel.security.CookieLoginModule:optional"
|
||||||
});
|
});
|
||||||
private final Parameter m_adminEmail = new StringParameter(
|
private final Parameter m_adminEmail = new StringParameter(
|
||||||
"waf.admin.contact_email", Parameter.OPTIONAL, null);
|
"waf.admin.contact_email", Parameter.OPTIONAL, null);
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,8 @@ public class UserLoginForm
|
||||||
private Password m_password;
|
private Password m_password;
|
||||||
private boolean m_autoRegistrationOn;
|
private boolean m_autoRegistrationOn;
|
||||||
private final SecurityConfig securityConfig = SecurityConfig.getConfig();
|
private final SecurityConfig securityConfig = SecurityConfig.getConfig();
|
||||||
|
|
||||||
|
private boolean ssoSuccessful = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor delegates to a constructor which creates a LoginForm
|
* Default constructor delegates to a constructor which creates a LoginForm
|
||||||
|
|
@ -230,6 +232,7 @@ public class UserLoginForm
|
||||||
try {
|
try {
|
||||||
Web.getUserContext().loginSSO();
|
Web.getUserContext().loginSSO();
|
||||||
s_log.info("loginSSO ok, now processing redirect_url");
|
s_log.info("loginSSO ok, now processing redirect_url");
|
||||||
|
ssoSuccessful = true;
|
||||||
process(event);
|
process(event);
|
||||||
return;
|
return;
|
||||||
} catch (LoginException le) {
|
} catch (LoginException le) {
|
||||||
|
|
@ -326,7 +329,8 @@ public class UserLoginForm
|
||||||
throw new ReturnSignal(req, url);
|
throw new ReturnSignal(req, url);
|
||||||
}
|
}
|
||||||
//Cancel:
|
//Cancel:
|
||||||
if (m_saveCancelSection.getCancelButton().isSelected(state)) {
|
if (m_saveCancelSection.getCancelButton().isSelected(state)
|
||||||
|
|| ssoSuccessful) {
|
||||||
|
|
||||||
//redirect the user to the place they came from.
|
//redirect the user to the place they came from.
|
||||||
try {
|
try {
|
||||||
|
|
@ -339,6 +343,7 @@ public class UserLoginForm
|
||||||
path),
|
path),
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
|
ssoSuccessful = false;
|
||||||
throw new ReturnSignal(req, refererURI);
|
throw new ReturnSignal(req, refererURI);
|
||||||
} catch (URISyntaxException e) {
|
} catch (URISyntaxException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ public class FreeMarkerPresentationManager implements PresentationManager {
|
||||||
pageTransformer.servePage(document, request, response);
|
pageTransformer.servePage(document, request, response);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final org.w3c.dom.Document w3cDocument = document.getInternalDocument();
|
final org.w3c.dom.Document w3cDocument = document.getInternalDocument();
|
||||||
|
|
||||||
final Node root = w3cDocument.getDocumentElement();
|
final Node root = w3cDocument.getDocumentElement();
|
||||||
|
|
@ -126,8 +126,9 @@ public class FreeMarkerPresentationManager implements PresentationManager {
|
||||||
final InputStream manifestInputStream = servletContext
|
final InputStream manifestInputStream = servletContext
|
||||||
.getResourceAsStream(themeManifestPath);
|
.getResourceAsStream(themeManifestPath);
|
||||||
if (manifestInputStream == null) {
|
if (manifestInputStream == null) {
|
||||||
LOGGER.error(String.format("No theme manifest found at path \"%s\". "
|
LOGGER.error(String.format(
|
||||||
+ "Falling back to \"%s\". Used sitename \"%s\".",
|
"No theme manifest found at path \"%s\". "
|
||||||
|
+ "Falling back to \"%s\". Used sitename \"%s\".",
|
||||||
themeManifestPath,
|
themeManifestPath,
|
||||||
PageTransformer.class.getName(),
|
PageTransformer.class.getName(),
|
||||||
currentSiteName));
|
currentSiteName));
|
||||||
|
|
@ -239,6 +240,10 @@ public class FreeMarkerPresentationManager implements PresentationManager {
|
||||||
new FormatDateTime(manifest.getDateFormats(),
|
new FormatDateTime(manifest.getDateFormats(),
|
||||||
new Locale(selectedLocale.getLanguage())));
|
new Locale(selectedLocale.getLanguage())));
|
||||||
|
|
||||||
|
configuration.setSharedVariable(
|
||||||
|
"sortAttachmentList", new SortAttachmentList()
|
||||||
|
);
|
||||||
|
|
||||||
data.put("serverName", request.getServerName());
|
data.put("serverName", request.getServerName());
|
||||||
data.put("serverPort", request.getServerPort());
|
data.put("serverPort", request.getServerPort());
|
||||||
data.put("userAgent", request.getHeader("user-Agent"));
|
data.put("userAgent", request.getHeader("user-Agent"));
|
||||||
|
|
@ -253,7 +258,7 @@ public class FreeMarkerPresentationManager implements PresentationManager {
|
||||||
response.setCharacterEncoding(StandardCharsets.UTF_8.toString());
|
response.setCharacterEncoding(StandardCharsets.UTF_8.toString());
|
||||||
response.setContentType("text/html");
|
response.setContentType("text/html");
|
||||||
|
|
||||||
try (PrintWriter writer = response.getWriter()) {
|
try ( PrintWriter writer = response.getWriter()) {
|
||||||
|
|
||||||
template.process(data, writer);
|
template.process(data, writer);
|
||||||
|
|
||||||
|
|
@ -442,7 +447,6 @@ public class FreeMarkerPresentationManager implements PresentationManager {
|
||||||
final String key = ((TemplateScalarModel) list
|
final String key = ((TemplateScalarModel) list
|
||||||
.get(0))
|
.get(0))
|
||||||
.getAsString();
|
.getAsString();
|
||||||
|
|
||||||
|
|
||||||
ResourceBundle.clearCache();
|
ResourceBundle.clearCache();
|
||||||
final ResourceBundle bundle = ResourceBundle.getBundle(bundleName,
|
final ResourceBundle bundle = ResourceBundle.getBundle(bundleName,
|
||||||
|
|
@ -604,6 +608,28 @@ public class FreeMarkerPresentationManager implements PresentationManager {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class SortAttachmentList implements TemplateMethodModelEx {
|
||||||
|
|
||||||
|
public SortAttachmentList() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object exec(final List list) throws TemplateModelException {
|
||||||
|
|
||||||
|
if (list.isEmpty() || list.size() != 2) {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"SortAttachmentList requires the following parameters: "
|
||||||
|
+ "list: list to sort, "
|
||||||
|
+ "attribute: Attribute to use for sorting"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return list.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private String findContentItemTemplate(
|
private String findContentItemTemplate(
|
||||||
final Templates templates,
|
final Templates templates,
|
||||||
final String objectType,
|
final String objectType,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue