Announcement Announcement Module
Collapse
No announcement yet.
how to use custom-authentication-provider Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to use custom-authentication-provider

    in ss2.04, i write a AuthenticationProvider,how i config it !below is the sample
    Code:
    <custom-authentication-provider   >
          
    	</custom-authentication-provider>
    
    	  <b:bean id="forumAuthenticationProvider"
    		class="org.springframework.security.providers.dao.DaoAuthenticationProvider">
    		<security:custom-authentication-provider/>
    		<b:property name="passwordEncoder" value="md5"></b:property>
    		<b:property name="userCache" ref="userCache"></b:property>
    		<b:property name="userDetailsService" ref="myUserService"></b:property>
    	</b:bean>
    Last edited by wincpt; Oct 20th, 2008, 06:35 AM.

  • #2
    You can try the code below:

    <beans:bean id="md5PasswordEncoder" class="org.springframework.security.providers.enco ding.Md5PasswordEncoder" />

    <beans:bean id="customUserDetailsService" scope="prototype" class="yourClass">
    ...................................
    </beans:bean>

    <beans:bean id="customAuthenticationProvider" class="com.demo.service.CustomAuthenticationProvid er">
    <custom-authentication-provider />
    <beans: property name="passwordEncoder" ref="md5PasswordEncoder" />
    <beans: property name="userDetailsService" ref="customUserDetailsService" />
    </beans:bean>

    Hope it helpful,
    Hsrock

    Comment


    • #3
      Thanks very much! I have resolve it

      Comment


      • #4
        error &quot;custom-authentication-provider&quot; must be declared.

        hello,

        please help me to resolve my problem
        i m getting error
        Element type "custom-authentication-provider" must be declared.

        [ERROR] BUILD ERROR
        [INFO] ------------------------------------------------------------------------
        [INFO] An exception occured while executing the Java class. null

        Element type "custom-authentication-provider" must be declared.
        [INFO] ------------------------------------------------------------------------
        [INFO] For more information, run Maven with the -e switch

        Comment


        • #5
          Originally posted by rashmi View Post
          hello,

          please help me to resolve my problem
          i m getting error
          Element type "custom-authentication-provider" must be declared.
          The schema declarations in your XML file are probably wrong. Please start with one of the sample configuration files or read the introductory chapter on the namespace chapter which has examples of what the schema declarations should look like.

          Comment

          Working...
          X