Results 1 to 2 of 2

Thread: Exception while configuration oauth2 provider

Hybrid View

  1. #1
    Join Date
    Mar 2011
    Location
    Ukraine, Lviv
    Posts
    12

    Default Exception while configuration oauth2 provider

    Configuration:
    Code:
    <beans:bean id="tokenServices" class="org.springframework.security.oauth2.provider.token.InMemoryOAuth2ProviderTokenServices">
    	<beans:property name="supportRefreshToken" value="true"/>
    </beans:bean>
    
    <oauth:provider client-details-service-ref="clientDetails" token-services-ref="tokenServices">    
    	<oauth:verification-code approval-handler-ref="myUserApprovalHandler" />
    </oauth:provider>
    Implementation:
    Code:
    public class MyUserApprovalHandler implements UserApprovalHandler {
    
        public boolean isApproved(ClientAuthenticationToken clientAuthentication) {
            return true;
        }
    }
    Why I get the next exception ?

    (Caused by: java.lang.IllegalStateException: Cannot convert value of type [org.springframework.security.oauth.examples.sparkl r.mvc.MyUserApprovalHandler] to required type [org.springframework.security.web.RedirectStrategy] for property 'redirectStrategy': no matching editors or conversion strategy found)

    Code:
     ERROR ContextLoader - Context initialization failed <org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChainProxy': Cannot resolve reference to bean 'oauth2VerificationCodeFilter' while setting bean property 'filterChainMap' with key [/**] with key [11]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'oauth2VerificationCodeFilter': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.security.oauth.examples.sparklr.mvc.MyUserApprovalHandler' to required type 'org.springframework.security.web.RedirectStrategy' for property 'redirectStrategy'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.security.oauth.examples.sparklr.mvc.MyUserApprovalHandler] to required type [org.springframework.security.web.RedirectStrategy] for property 'redirectStrategy': no matching editors or conversion strategy found>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChainProxy': Cannot resolve reference to bean 'oauth2VerificationCodeFilter' while setting bean property 'filterChainMap' with key [/**] with key [11]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'oauth2VerificationCodeFilter': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.security.oauth.examples.sparklr.mvc.MyUserApprovalHandler' to required type 'org.springframework.security.web.RedirectStrategy' for property 'redirectStrategy'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.security.oauth.examples.sparklr.mvc.MyUserApprovalHandler] to required type [org.springframework.security.web.RedirectStrategy] for property 'redirectStrategy': no matching editors or conversion strategy found
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:355)

  2. #2
    Join Date
    May 2008
    Location
    Salt Lake City
    Posts
    167

    Default

    Ya. Sorry about that. It's a bug in the configuration code. It's been fixed in HEAD.

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
  •