title: Using Picketlink and Wildfly for authenticate on LDAP server
body: <p>After some some struggling I configured my wildfly's standalone.xml to authenticate agains an LDAP-Server:</p>
  
  <pre><code>               &lt;security-domain name="LDAPAuth" cache-type="default"&gt;
                  &lt;authentication&gt;
                      &lt;login-module code="org.jboss.security.auth.spi.LdapExtLoginModule" flag="required"&gt;
                          &lt;module-option name="java.naming.provider.url" value="ldap://URL:389"/&gt;
                          &lt;module-option name="bindDN" value="username"/&gt;
                          &lt;module-option name="bindCredential" value="password"/&gt;
                          &lt;module-option name="baseCtxDN" value="OU=UsersDC=domain,DC=com"/&gt;
                          &lt;module-option name="baseFilter" value="(sAMAccountName={0})"/&gt;
                          &lt;module-option name="allowEmptyPasswords" value="false"/&gt;
                      &lt;/login-module&gt;
                  &lt;/authentication&gt;
              &lt;/security-domain&gt;
  </code></pre>
  
  <p>I also configured my jboss-web:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jboss-web xmlns:cr="http://www.jboss.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="
    http://www.jboss.com/xml/ns/javaee
    http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd"&gt;
      &lt;cr:context-root&gt;/projectName&lt;/cr:context-root&gt;
      &lt;security-domain&gt;LDAPAuth&lt;/security-domain&gt;
      &lt;use-jboss-authorization&gt;true&lt;/use-jboss-authorization&gt;
  &lt;/jboss-web&gt;
  </code></pre>
  
  <p>and my web.xml:</p>
  
  <pre><code>&lt;login-config&gt;
      &lt;auth-method&gt;BASIC&lt;/auth-method&gt;
      &lt;realm-name&gt;LDAPAuth realm&lt;/realm-name&gt;
      &lt;form-login-config&gt;
          &lt;form-login-page&gt;/login.xhtml&lt;/form-login-page&gt;
          &lt;form-error-page&gt;/error.xhtml&lt;/form-error-page&gt;
      &lt;/form-login-config&gt;
  &lt;/login-config&gt;
  ...
  </code></pre>
  
  <p>and everything works fine.</p>
  
  <p>The next step is to use PicketLink. But I can't find out how to configure PicketLink to use my security-domain.</p>
  
  <p>I can find examples and tutorials for establish the LDAP connection programmatically and how I can set up PicketLink to work with Identity and Service Providers.
  But as I know my use case contains the Identity Provider and the Service Provider?!? So there is no dedicated server I want to connect with. The LDAP query is handled by my wildfly server. In every example I can find both servers are seperated machines. Did I understand something wrong?
  After hours of 'googleing' I'm getting more and more confused.</p>
  
  <p>I added</p>
  
  <pre><code>&lt;valve&gt;
       &lt;class-name&gt;org.picketlink.identity.federation.bindings.tomcat.idp.IDPWebBrowserSSOValve&lt;/class-name&gt;
  &lt;/valve&gt;
  </code></pre>
  
  <p>But I don't know how to configurate the picketlink.xml. What's the URL of my Identity Provider?
  I believe there's just one part I understand wrong. Can someone help me? :-D</p>