Results 1 to 5 of 5

Thread: how to use custom-authentication-provider

  1. #1
    Join Date
    Oct 2008
    Posts
    2

    Red face 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 at 05:35 AM.

  2. #2
    Join Date
    Nov 2008
    Posts
    1

    Default

    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

  3. #3
    Join Date
    Oct 2008
    Posts
    2

    Default

    Thanks very much! I have resolve it

  4. #4

    Default error "custom-authentication-provider" 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

  5. #5
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    Quote 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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •