mirror of
https://github.com/nicolabs/ldap-plugin.git
synced 2025-09-07 05:14:24 +02:00
bug fix in the UI&code coordination.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6229 71c3de6d-444a-0410-be80-ed276b4c234a Originally-Committed-As: e1f0531714cc8ff58f108895e2509e3a1f15504b
This commit is contained in:
parent
01e6a2a41e
commit
12fe30b517
|
@ -1,7 +1,11 @@
|
|||
package hudson.security;
|
||||
|
||||
import org.acegisecurity.AuthenticationManager;
|
||||
import org.acegisecurity.MockAuthenticationManager;
|
||||
import org.kohsuke.stapler.StaplerRequest;
|
||||
import org.kohsuke.stapler.DataBoundConstructor;
|
||||
import hudson.model.Descriptor;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
/**
|
||||
* {@link SecurityRealm} implementation that uses LDAP for authentication.
|
||||
|
@ -9,8 +13,16 @@ import hudson.model.Descriptor;
|
|||
* @author Kohsuke Kawaguchi
|
||||
*/
|
||||
public class LDAPSecurityRealm extends SecurityRealm {
|
||||
public final String providerUrl;
|
||||
|
||||
@DataBoundConstructor
|
||||
public LDAPSecurityRealm(String providerUrl) {
|
||||
this.providerUrl = providerUrl;
|
||||
}
|
||||
|
||||
public AuthenticationManager createAuthenticationManager() {
|
||||
throw new UnsupportedOperationException();
|
||||
// TODO
|
||||
return new MockAuthenticationManager(true);
|
||||
}
|
||||
|
||||
public DescriptorImpl getDescriptor() {
|
||||
|
@ -24,6 +36,10 @@ public class LDAPSecurityRealm extends SecurityRealm {
|
|||
super(LDAPSecurityRealm.class);
|
||||
}
|
||||
|
||||
public LDAPSecurityRealm newInstance(StaplerRequest req, JSONObject formData) throws FormException {
|
||||
return req.bindJSON(LDAPSecurityRealm.class,formData);
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return "LDAP";
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
|
||||
<f:entry title="Server" >
|
||||
<f:textbox name="ldap.server" value="${instance}" />
|
||||
<f:entry title="Server URL" >
|
||||
<f:textbox name="ldap.providerUrl" value="${instance.providerUrl}" />
|
||||
</f:entry>
|
||||
</j:jelly>
|
Loading…
Reference in a new issue