Results 1 to 4 of 4

Thread: Overriding OAuth2AuthorizationFilter

  1. #1
    Join Date
    Nov 2010
    Posts
    10

    Default Overriding OAuth2AuthorizationFilter

    Hi,

    I'm trying to override the behaviour of OAuth2AuthorizationFilter. There are a couple of posts on this subject. One post implies it's not trivial to override. The other I've tried by declaring a bean in applicationContext:

    <beans:bean id="oauth2AuthorizationFilter" class="org.springframework.security.oauth2.provide r.CustomOAuth2AuthorizationFilter">
    </beans:bean>

    but couldn't get this to pick up.

    I'm trying to model different grant types using separate paths:

    /oauth/authorize - for resource owner password grant type
    /oauth/refresh - for exchanging a refresh token for an access token.

    and I still want OAuth2AuthorizationFilter to do the work and want to avoid running two instances of the filter in the chain. If that makes sense.

    Any help would be much appreciated.

    J

  2. #2
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    I haven't tried it, but the bean override should work if you define that bean *after* the <oauth:provider/>. To me this seems rather brittle anyway, so I have issues with the way <oauth:provider/> is implemented. Maybe it would be better to make all the filter configuration more explicit, so you can easily see where the individual filters are and inject your customizations directly?
    Last edited by Dave Syer; Aug 1st, 2011 at 08:19 AM. Reason: formatting

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

    Default

    Quote Originally Posted by Dave Syer View Post
    I haven't tried it, but the bean override should work if you define that bean *after* the <oauth:provider/>.
    Jeremy, did that work?

    Quote Originally Posted by Dave Syer View Post
    To me this seems rather brittle anyway,
    Probably true. We could make it less brittle by making that bean name explicit in the config file, but that doesn't address your other concerns...

    Quote Originally Posted by Dave Syer View Post
    so I have issues with the way <oauth:provider/> is implemented. Maybe it would be better to make all the filter configuration more explicit, so you can easily see where the individual filters are and inject your customizations directly?
    Seems reasonable to consider. Is there an issue open on this?

  4. #4
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    Is there an issue open on this?
    There is now: https://jira.springsource.org/browse/SECOAUTH-97

Posting Permissions

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