NIHVIVO-1393 The external authorization URL is not configurable.
This commit is contained in:
parent
ec12b4db3d
commit
a0225f1cc9
1 changed files with 10 additions and 8 deletions
|
@ -21,8 +21,10 @@ import freemarker.core.Environment;
|
||||||
import freemarker.template.TemplateModel;
|
import freemarker.template.TemplateModel;
|
||||||
|
|
||||||
public class LoginWidget extends Widget {
|
public class LoginWidget extends Widget {
|
||||||
|
private static final Log log = LogFactory.getLog(LoginWidget.class);
|
||||||
|
|
||||||
private static final Log log = LogFactory.getLog(LoginWidget.class);
|
/** The page that kicks off the External Authentication process. */
|
||||||
|
private static final String EXTERNAL_AUTH_SETUP_URL = "/loginExternalAuth";
|
||||||
|
|
||||||
private static enum Macro {
|
private static enum Macro {
|
||||||
LOGIN("loginForm"),
|
LOGIN("loginForm"),
|
||||||
|
@ -118,13 +120,13 @@ public class LoginWidget extends Widget {
|
||||||
values.put(TemplateVariable.FORM_ACTION.toString(), getAuthenticateUrl(request));
|
values.put(TemplateVariable.FORM_ACTION.toString(), getAuthenticateUrl(request));
|
||||||
values.put(TemplateVariable.LOGIN_NAME.toString(), bean.getUsername());
|
values.put(TemplateVariable.LOGIN_NAME.toString(), bean.getUsername());
|
||||||
|
|
||||||
String externalAuthServerUrl = ConfigurationProperties.getProperty("externalAuth.url");
|
String externalAuthDisplayName = ConfigurationProperties.getProperty("externalAuth.displayName");
|
||||||
externalAuthServerUrl = UrlBuilder.getUrl(externalAuthServerUrl);
|
if (externalAuthDisplayName != null) {
|
||||||
if (externalAuthServerUrl != null) {
|
values.put(TemplateVariable.EXTERNAL_AUTH_URL.toString(),
|
||||||
values.put(TemplateVariable.EXTERNAL_AUTH_URL.toString(), externalAuthServerUrl);
|
UrlBuilder.getUrl(EXTERNAL_AUTH_SETUP_URL));
|
||||||
values.put(TemplateVariable.EXTERNAL_AUTH_NAME.toString(),
|
values.put(TemplateVariable.EXTERNAL_AUTH_NAME.toString(),
|
||||||
ConfigurationProperties.getProperty("externalAuth.displayName"));
|
externalAuthDisplayName);
|
||||||
}
|
}
|
||||||
|
|
||||||
String infoMessage = bean.getInfoMessage();
|
String infoMessage = bean.getInfoMessage();
|
||||||
if (!infoMessage.isEmpty()) {
|
if (!infoMessage.isEmpty()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue