Results 1 to 4 of 4

Thread: Customizing Resource Server Filters to use custom ExceptionRenderer

  1. #1
    Join Date
    May 2012
    Posts
    8

    Question Customizing Resource Server Filters to use custom ExceptionRenderer

    I have a provider configuration setup using the oauth:resource-server tag, but want to customize the way that errors are handling by using my own ExceptionRenderer that the AuthenticationEntryPoint uses. In order to do this, I have to be able to set the AuthenticationEntryPoint in the OAuth2AuthenticationProcessingFilter object.

    Is there a way to set the AuthenticationEntryPoint with the oauth:resource-server tag, or do I need to remove this tag altogether and manually create the filters that this tag creates? If so, how do I figure out which beans this tag creates? I can't find it in the docs.

    The reason for customizing this is that my RESTful API uses extensions (.json,.xml, etc.) to determine content to return, and ignores the Accept headers. The DefaultOAuth2ExceptionRenderer bases content type on Accept header only.

    Thanks!

    Adam

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

    Default

    Here's an example:

    Code:
    <oauth:resource-server id="openidResourceAuthenticationFilter" token-services-ref="tokenServices"
    		resource-id="openid" entry-point-ref="oauthAuthenticationEntryPoint" />
    The XSD is documented (not brilliantly, but some), so if you have a decent XML editor you should be able to discover those features with auto-complete (e.g. CTRL-SPC iun Eclispe). STS (or Spring IDE) picks up the schema from the classpath, so it should be quite reliable.

  3. #3
    Join Date
    May 2012
    Posts
    8

    Default

    Quote Originally Posted by Dave Syer View Post
    Here's an example:

    Code:
    <oauth:resource-server id="openidResourceAuthenticationFilter" token-services-ref="tokenServices"
    		resource-id="openid" entry-point-ref="oauthAuthenticationEntryPoint" />
    The XSD is documented (not brilliantly, but some), so if you have a decent XML editor you should be able to discover those features with auto-complete (e.g. CTRL-SPC iun Eclispe). STS (or Spring IDE) picks up the schema from the classpath, so it should be quite reliable.
    I might be on a different version... the XSD that I'm referencing is http://www.springframework.org/schem...ity-oauth2.xsd , and the resource-server element only has three attributes available: resource-id, token-services-ref, and serialization-service-ref. This is also what my auto-complete in Eclipse IDE is telling me.

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

    Default

    OK. I'll get the static server updated. If you use Spring IDE you don't need the internet version because its on the classpath.

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
  •