Results 1 to 2 of 2

Thread: Spring Security Authorization Server ignoring "authorization-code-services-ref"

  1. #1
    Join Date
    Nov 2012
    Posts
    9

    Question [SOLVED] - Authorization Server "authorization-code-services-ref" ignored

    I'm trying to set my project to use JdbcAuthorizationCodeService. I have set it as the following:
    Code:
    <beans:bean id="authorizationCodeServices" c:dataSource-ref="dataSource" class="org.springframework.security.oauth2.provider.code.JdbcAuthorizationCodeServices"/>
    	
    <oauth:authorization-server client-details-service-ref="clientDetails" token-services-ref="tokenServices">
    	<oauth:authorization-code authorization-code-services-ref="authorizationCodeServices" />
    	<oauth:implicit />
    	<oauth:refresh-token />
    	<oauth:client-credentials />
    	<oauth:password />
    </oauth:authorization-server>
    While running on debug mode I'm able to see that the constructor is called. However, when I ask for an authorization code, it works but nothing is persisted to the database. Any idea why this happens? Is this a know issue?

    EDIT:
    Also I'm using the 1.0.1 RELEASE version. And I tried to debug the beans parser for the authorization-server tag and it is called twice. The first time it catches the right reference, the second time it considers that authorization-code-services-ref is empty. I really don't know what is causing to parse it twice and the second time it is probably parsing another definition. But that's the only one I have. Any tips?
    Last edited by petersaints; Feb 28th, 2013 at 04:23 PM. Reason: I found out what the problem was and posted below the solution.

  2. #2
    Join Date
    Nov 2012
    Posts
    9

    Default

    Answering myself... My Oauth2 base configuration was made by a Roo addon so it added another authorization-server element in webmvc-config.xml. I wasn't aware of that, but after the previous edit in the opeing post, I searched for authorization-server accross my project and I found the duplicate. So it was my bad. Neverthless... this tip can be helpful for someone else in the same situation.

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
  •