Announcement Announcement Module
Collapse
No announcement yet.
custom expression handler for filter invocations? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • custom expression handler for filter invocations?

    I found how to configure a custom expression handler and apply it to method security:

    Code:
      <global-method-security pre-post-annotations="enabled">
        <expression-handler ref="oauthExpressionHandler"/>
      </global-method-security>
    But how do I apply it to the http filter security? I'd expect something like this:

    Code:
      <http use-expressions="true">
        <expression-handler ref="oauthExpressionHandler"/>
      </http>
    But that's not supported.

  • #2
    This will be in 3.1.0, but in the mean time, the easiest way to do this is to create a BeanPostProcessor as shown in the FAQ. The implementation would override the current expression handler with a custom one. For example:

    Code:
    public Object postProcessBeforeInitialization(Object bean, String beanName)
        throws BeansException {
      if (bean instanceof DefaultWebSecurityExpressionHandler) {
        return new OAuthExpressionHandler();
      }
      return bean;
    }

    Comment

    Working...
    X