Announcement Announcement Module
Collapse
No announcement yet.
Spring Security Authorization Server ignoring "authorization-code-services-ref" Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Security Authorization Server ignoring "authorization-code-services-ref"

    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, 04:23 PM. Reason: I found out what the problem was and posted below the solution.

  • #2
    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.

    Comment

    Working...
    X