Announcement Announcement Module
Collapse
No announcement yet.
Customizing Resource Server Filters to use custom ExceptionRenderer Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment


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

      Comment


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

        Comment

        Working...
        X