From c73508b91eb3afd243ef42d63160f5c5f287a31c Mon Sep 17 00:00:00 2001 From: Carsten Thiel Date: Fri, 17 Jun 2016 11:58:54 +0200 Subject: [PATCH] add possibility for custom login link --- .../reverse_proxy_auth/ReverseProxySecurityRealm.java | 9 ++++++++- .../ReverseProxySecurityRealm/config.jelly | 3 +++ .../ReverseProxySecurityRealm/loginLink.jelly | 7 +++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/reverse_proxy_auth/ReverseProxySecurityRealm.java b/src/main/java/org/jenkinsci/plugins/reverse_proxy_auth/ReverseProxySecurityRealm.java index 05a8e18..bd0a6b3 100644 --- a/src/main/java/org/jenkinsci/plugins/reverse_proxy_auth/ReverseProxySecurityRealm.java +++ b/src/main/java/org/jenkinsci/plugins/reverse_proxy_auth/ReverseProxySecurityRealm.java @@ -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) { @@ -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 { diff --git a/src/main/resources/org/jenkinsci/plugins/reverse_proxy_auth/ReverseProxySecurityRealm/config.jelly b/src/main/resources/org/jenkinsci/plugins/reverse_proxy_auth/ReverseProxySecurityRealm/config.jelly index 65fb028..dc9c87b 100644 --- a/src/main/resources/org/jenkinsci/plugins/reverse_proxy_auth/ReverseProxySecurityRealm/config.jelly +++ b/src/main/resources/org/jenkinsci/plugins/reverse_proxy_auth/ReverseProxySecurityRealm/config.jelly @@ -33,6 +33,9 @@ THE SOFTWARE. + + + diff --git a/src/main/resources/org/jenkinsci/plugins/reverse_proxy_auth/ReverseProxySecurityRealm/loginLink.jelly b/src/main/resources/org/jenkinsci/plugins/reverse_proxy_auth/ReverseProxySecurityRealm/loginLink.jelly index e3309dc..415846a 100644 --- a/src/main/resources/org/jenkinsci/plugins/reverse_proxy_auth/ReverseProxySecurityRealm/loginLink.jelly +++ b/src/main/resources/org/jenkinsci/plugins/reverse_proxy_auth/ReverseProxySecurityRealm/loginLink.jelly @@ -1,2 +1,5 @@ - - \ No newline at end of file + + + ${%login} + +