2010-01-29 2 views
2

스프링 보안 OpenID 기능을 작동시키는 데 문제가 있습니다. http://spring.security.test.myopenid.com/을 입력으로 사용하면 아래 오류가 표시됩니다. 다음은 예외가 발생하는 곳을 보여주는 스프링 source에 대한 링크입니다. 어떤 아이디어?스프링 보안 OpenID - 처리 할 수없는 소유권 "null"

소유권 주장을 처리 할 수 ​​없습니다. 'null'.

의 ApplicationContext-security.xml :

<beans:beans xmlns="http://www.springframework.org/schema/security" 
    xmlns:beans="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
     http://www.springframework.org/schema/security 
     http://www.springframework.org/schema/security/spring-security-3.0.xsd"> 

    <http> 
     <intercept-url pattern="/**" access="ROLE_USER" /> 
     <intercept-url pattern="/login/" filters="none" /> 
     <intercept-url pattern="/" filters="none" /> 
     <logout /> 
     <openid-login login-page="/login/" authentication-failure-url="/login/?login_error=true"> 
      <attribute-exchange> 
       <openid-attribute name="email" type="http://schema.openid.net/contact/email" /> 
       <openid-attribute name="name" type="http://schema.openid.net/namePerson/friendly" /> 
      </attribute-exchange> 
     </openid-login> 
     <remember-me token-repository-ref="tokenRepository"/> 
    </http> 

    <beans:bean id="tokenRepository" 
     class="org.springframework.security.web.authentication.rememberme.InMemoryTokenRepositoryImpl" /> 

    <authentication-manager alias="authenticationManager" /> 

    <user-service id="userService"> 
      <user name="http://spring.security.test.myopenid.com/" password="password" authorities="ROLE_SUPERVISOR,ROLE_USER" /> 
    </user-service> 

</beans:beans> 

의 login.jsp : 아마

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
    <head> 
     <title>Test GAE</title> 
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 
    </head> 
    <body> 
     <h3>Please Enter Your OpenID Identity</h3> 

     <c:if test="${not empty param.login_error}"> 
      Your login attempt was not successful, try again.<br/><br/> 
      Reason: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}"/>. 
     </c:if> 

     <form action="<c:url value='/j_spring_openid_security_check'/>" method="post"> 
      <table> 
       <tr><td>OpenID Identity:</td><td><input type='text' name='j_username' value='<c:if test="${not empty param.login_error}"><c:out value="${SPRING_SECURITY_LAST_USERNAME}"/></c:if>'/></td></tr> 
       <tr><td><input type="checkbox" name="_spring_security_remember_me" /></td><td>Remember me on this computer.</td></tr> 
       <tr><td colspan='2'><input name="submit" type="submit" /></td></tr> 
       <tr><td colspan='2'><input name="reset" type="reset" /></td></tr> 
      </table> 
     </form> 
    </body> 
</html> 
+0

저는 Spring 3.0.0.RELEASE와 Spring Security 3.0.1.RELEASE를 사용하고 있습니다. –

답변

1

, 당신이 당신의 <input ...> 이름의 소스에서

openid_identifier에 의해 j_username를 교체해야합니다 :

/** 
* The name of the request parameter containing the OpenID identity, as submitted from  the initial login form. 
* 
* @param claimedIdentityFieldName defaults to "openid_identifier" 
*/ 
+0

흥미 롭습니다. 이제 새로운 예외가 생깁니다. /j_spring_openid_security_check java.security.AccessControlException : 액세스 거부 (java.lang.RuntimePermission의 modifyThreadGroup) java.security.AccessControlContext.checkPermission (AccessControlContext.java:355) java.security.AccessController.checkPermission에서 \t (AccessController에에서 \t .java : 567) \t에서 java.lang.SecurityManager.checkPermission (알 수없는 소스) –

+0

이 질문은 관련이 보입니다 : http://stackoverflow.com/questions/1620823/accesscontrolexception-when-using-spring-security-with-openid –