Skip to content

Commit 24f1413

Browse files
Merge pull request #26 from DARIAH-DE/custom_login_link
Add possibility for custom login link
2 parents a728d20 + c73508b commit 24f1413

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

src/main/java/org/jenkinsci/plugins/reverse_proxy_auth/ReverseProxySecurityRealm.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,11 @@ public class ReverseProxySecurityRealm extends SecurityRealm {
269269
/**
270270
* Custom post logout url
271271
*/
272+
public final String customLogInUrl;
272273
public final String customLogOutUrl;
273274

274275
@DataBoundConstructor
275-
public ReverseProxySecurityRealm(String forwardedUser, String headerGroups, String headerGroupsDelimiter, String customLogOutUrl, String server, String rootDN, boolean inhibitInferRootDN,
276+
public ReverseProxySecurityRealm(String forwardedUser, String headerGroups, String headerGroupsDelimiter, String customLogInUrl, String customLogOutUrl, String server, String rootDN, boolean inhibitInferRootDN,
276277
String userSearchBase, String userSearch, String groupSearchBase, String groupSearchFilter, String groupMembershipFilter, String groupNameAttribute, String managerDN, String managerPassword,
277278
Integer updateInterval, boolean disableLdapEmailResolver, String displayNameLdapAttribute, String emailAddressLdapAttribute) {
278279

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

289+
if(!StringUtils.isBlank(customLogInUrl)) {
290+
this.customLogInUrl = customLogInUrl;
291+
} else {
292+
this.customLogInUrl = null;
293+
}
294+
288295
if(!StringUtils.isBlank(customLogOutUrl)) {
289296
this.customLogOutUrl = customLogOutUrl;
290297
} else {

src/main/resources/org/jenkinsci/plugins/reverse_proxy_auth/ReverseProxySecurityRealm/config.jelly

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ THE SOFTWARE.
3333
<f:textbox field="headerGroupsDelimiter" default="|" />
3434
</f:entry>
3535
<f:advanced>
36+
<f:entry title="${%Custom Log In URL}" >
37+
<f:textbox name="customLogInUrl" value="${instance.customLogInUrl}" />
38+
</f:entry>
3639
<f:entry title="${%Custom Log Out URL}" >
3740
<f:textbox name="customLogOutUrl" value="${instance.customLogOutUrl}" />
3841
</f:entry>
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
<!-- no login link -->
2-
<j:jelly xmlns:j="jelly:core" />
1+
<j:jelly xmlns:j="jelly:core">
2+
<j:if test="${it.customLogInUrl != null}">
3+
<a href="${it.customLogInUrl}"><b>${%login}</b></a>
4+
</j:if>
5+
</j:jelly>

0 commit comments

Comments
 (0)