Announcement Announcement Module
Collapse
No announcement yet.
No AuthenticationEntryPoint could be established..Spring 3.0 security Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No AuthenticationEntryPoint could be established..Spring 3.0 security

    hi Folks,

    I get this message when I deploy the app. This is the vmis-security-context.xml file

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:sec="http://www.springframework.org/schema/security"
    	xmlns:util="http://www.springframework.org/schema/util"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.springframework.org/schema/util http://www.springframework.org/schem...g-util-3.0.xsd
    						http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-3.0.xsd
                            http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
    
        
        
        	
        	<sec:global-method-security
    			secured-annotations="enabled">
    	</sec:global-method-security>
        	
        	<sec:http auto-config="false" entry-point-ref="preAuthenticatedProcessingFilterEntryPoint"
        		access-decision-manager-ref="accessDecisionManager">
        		<sec:logout />
    	</sec:http>
        
        
        <bean id="preAuthenticatedProcessingFilterEntryPoint"
                class="org.springframework.security.web.authentication.Http403ForbiddenEntryPoint"/> 
    
      	
      	<sec:http>
    	     <sec:custom-filter ref="preAuthenticatedProcessingFilter" position="PRE_AUTH_FILTER" />
      	</sec:http>
      	
      	<bean id="preAuthenticatedProcessingFilter"
    			class="org.springframework.security.ui.preauth.header.RequestHeaderPreAuthenticatedProcessingFilter">
    			<!-- <sec:custom-filter ref="PRE_AUTH_FILTER" />  -->
    			<property name="principalRequestHeader" value="HTTP_VOL_ID" />
    			<property name="authenticationManager" ref="authenticationManager" />
    	</bean>
      	
      	<bean id="preauthAuthProvider"
    	      class="org.springframework.security.providers.preauth.PreAuthenticatedAuthenticationProvider">
    	   <!-- <sec:custom-authentication-provider />      -->
    	    <property name="preAuthenticatedUserDetailsService">
    	    	<bean id="userDetailsServiceWrapper" 
    	            class="org.springframework.security.userdetails.UserDetailsByNameServiceWrapper">
    	        	<property name="userDetailsService" ref="ismUserProfileService"/>
    	    	</bean>    
    	    </property>
    	</bean>
    	
    	
    		<sec:authentication-manager alias="authenticationManager" >
    			<sec:authentication-provider ref="preauthAuthProvider" />
    		</sec:authentication-manager>  
    
    
    	<bean id="accessDecisionManager" class="org.springframework.security.vote.AffirmativeBased"> 
            <property name="decisionVoters"> 
                <bean class="org.aarp.ism.securitymanager.service.IsmRoleVoter"> 
                    <property name="rolePrefix" value=""/> <!-- No prefix -->
                </bean> 
            </property> 
        </bean> 
    
    
    </beans>

    I am migrating someone else's code from Spring 2.5.6 and Spring security 2.0 to Spring 3.0 and Spring Security 3.0. Thanks for your help.

  • #2
    OK..This is the error.

    Code:
    ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
    org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: No AuthenticationEntryPoint could be established. Please make sure you have a login mechanism configured through the namespace (such as form-login) or specify a custom AuthenticationEntryPoint with the 'entry-point-ref' attribute 
    Offending resource: URL [jar:file:/C:/apache-tomcat-6.0.20-dsp-recruitment/webapps/portal%23core/WEB-INF/lib/ism-securitymanager-api.jar!/org/aarp/ism/securitymanager/service/spring-ism-security.xml]
    	at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
    	at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
    	at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:72)
    	at org.springframework.security.config.http.AuthenticationConfigBuilder.selectEntryPoint(AuthenticationConfigBuilder.java:516)
    	at org.springframework.security.config.http.AuthenticationConfigBuilder.createExceptionTranslationFilter(AuthenticationConfigBuilder.java:412)
    	at org.springframework.security.config.http.HttpSecurityBeanDefinitionParser.parse(HttpSecurityBeanDefinitionParser.java:114)
    	at org.springframework.security.config.SecurityNamespaceHandler.parse(SecurityNamespaceHandler.java:56)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1335)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:136)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)

    Comment


    • #3
      You have two <http> blocks (which should cause an error in itself). There should only be one.

      The second one has no login mechanism or entry-point defined (as the error message says).

      Comment


      • #4
        that worked...

        Thanks Luke. I removed the 2nd <http> and I don't get that exception now.

        Finally it's come to this

        Code:
        Cannot create inner bean 'userDetailsServiceWrapper' of type [org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper]
         while setting bean property 'preAuthenticatedUserDetailsService'; 
        nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsServiceWrapper' defined in 
        URL [jar:file:/C:/apache-tomcat-6.0.20-dsp-recruitment/webapps/portal%23core/WEB-INF/lib/ism-securitymanager-api.jar!/org/aarp/ism/securitymanager/service/spring-ism-security.xml]: 
        
        Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.aarp.ism.securitymanager.service.IsmUserProfileService' 
        to required type 'org.springframework.security.core.userdetails.UserDetailsService' for property 'userDetailsService'; 
        nested exception is java.lang.IllegalStateException: 
        Cannot convert value of type [org.aarp.ism.securitymanager.service.IsmUserProfileService] to required type [org.springframework.security.core.userdetails.UserDetailsService]
         for property 'userDetailsService': no matching editors or conversion strategy found
        I don;t have the source code for this yet. I just have the jar file and it looks like 'org.aarp.ism.securitymanager.service.IsmUserProfi leService' is not of type 'org.springframework.security.core.userdetails.Use rDetailsService'.

        So, I have to rewrite the code. I see here that http://static.springsource.org/sprin...l/ch02s02.html that Spring 3.0 is compatible with Spring security 2.0.x. Isn't that the case?

        Is there any reference code for possible UserDetailsService implementation?

        Comment

        Working...
        X