Skip to content

Commit

Permalink
add possibility for custom login link
Browse files Browse the repository at this point in the history
  • Loading branch information
schildwaechter committed Jun 22, 2016
1 parent a728d20 commit c73508b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,11 @@ public class ReverseProxySecurityRealm extends SecurityRealm {
/**
* Custom post logout url
*/
public final String customLogInUrl;
public final String customLogOutUrl;

@DataBoundConstructor
public ReverseProxySecurityRealm(String forwardedUser, String headerGroups, String headerGroupsDelimiter, String customLogOutUrl, String server, String rootDN, boolean inhibitInferRootDN,
public ReverseProxySecurityRealm(String forwardedUser, String headerGroups, String headerGroupsDelimiter, String customLogInUrl, String customLogOutUrl, String server, String rootDN, boolean inhibitInferRootDN,
String userSearchBase, String userSearch, String groupSearchBase, String groupSearchFilter, String groupMembershipFilter, String groupNameAttribute, String managerDN, String managerPassword,
Integer updateInterval, boolean disableLdapEmailResolver, String displayNameLdapAttribute, String emailAddressLdapAttribute) {

Expand All @@ -285,6 +286,12 @@ public ReverseProxySecurityRealm(String forwardedUser, String headerGroups, Stri
this.headerGroupsDelimiter = "|";
}

if(!StringUtils.isBlank(customLogInUrl)) {
this.customLogInUrl = customLogInUrl;
} else {
this.customLogInUrl = null;
}

if(!StringUtils.isBlank(customLogOutUrl)) {
this.customLogOutUrl = customLogOutUrl;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ THE SOFTWARE.
<f:textbox field="headerGroupsDelimiter" default="|" />
</f:entry>
<f:advanced>
<f:entry title="${%Custom Log In URL}" >
<f:textbox name="customLogInUrl" value="${instance.customLogInUrl}" />
</f:entry>
<f:entry title="${%Custom Log Out URL}" >
<f:textbox name="customLogOutUrl" value="${instance.customLogOutUrl}" />
</f:entry>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
<!-- no login link -->
<j:jelly xmlns:j="jelly:core" />
<j:jelly xmlns:j="jelly:core">
<j:if test="${it.customLogInUrl != null}">
<a href="${it.customLogInUrl}"><b>${%login}</b></a>
</j:if>
</j:jelly>

0 comments on commit c73508b

Please sign in to comment.