私はldap + spring securityを学ぼうとしています。Apache DS を使用して Local Dev をセットアップしました。
コンパイルしてエラーなしで実行できるようになりましたが、ログインしようとしても何も実行されず、エラーメッセージも表示されません。DS がリクエストを受け取っているかどうかさえわかりません。
誰かがこれをデバッグするためのアドバイスを持っているか、問題を見ることができれば、それは素晴らしいことです.
JSP:
<form action="/j_spring_security_check.action" method="POST">
<span><label for="username">User Name:</label>
<input id="username" name="j_username" type="text"/></span>
<span><label for="password">Password:</label>
<input id="password" name="j_password" type="password"/></span>
<span><input type="submit" value="Log In"/></span>
</form>
アプリケーションのコンテキスト:
<bean id="contextSource"
class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
<constructor-arg value="ldap://localhost:389/dc=example,dc=com"/>
<property name="userDn" value="cn=system,dc=example,dc=com"/>
<property name="password" value="password"/>
</bean>
<bean id="ldapAuthProvider"
class="org.springframework.security.ldap.authentication.LdapAuthenticationProvider">
<constructor-arg>
<bean class="org.springframework.security.ldap.authentication.BindAuthenticator">
<constructor-arg ref="contextSource"/>
<property name="userDnPatterns"><list><value>uid={0},ou=system</value></list></property>
</bean>
</constructor-arg>
<constructor-arg>
<bean class="org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator">
<constructor-arg ref="contextSource"/>
<constructor-arg value="ou=system"/>
<property name="groupRoleAttribute" value="ou"/>
<property name="defaultRole" value="ROLE_ADMIN"/>
</bean>
</constructor-arg>
</bean>
春のセキュリティ:
<http auto-config="true" use-expressions="true">
<intercept-url pattern="/noSecurityJSP/**" access="permitAll()"/>
<intercept-url pattern="/login*" access="permitAll()"/>
<intercept-url pattern="/resources/**" access="permitAll()"/>
<intercept-url pattern="/**" access="isAuthenticated()"/>
<form-login
login-page="/login.htm"
login-processing-url="/j_spring_security_check.action"
authentication-failure-url="/splash_page.htm?error=true"
default-target-url="/welcomePage.htm"
always-use-default-target="true"/>
</http>
<authentication-manager>
<authentication-provider ref='ldapAuthProvider'/>
</authentication-manager>
Spring Maven の依存関係:
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-ldap</artifactId>
<version>3.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap-core</artifactId>
<version>1.3.2.RELEASE</version>
LDAP の写真
