Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.61 KB

learning_java_spring_security.md

File metadata and controls

39 lines (27 loc) · 1.61 KB
path title
/learnings/java_spring_security
Learnings: Java: Spring: Security

Table Of Contents

Implementing your own Oauth server

You have your own AuthorizationServerConfigurerAdapter yah?

I want to add a filter chain filter, to say capture a tracing header from a request

Add a middleware filter like so:

public void configure(org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer oauthServerConfig) {
    oauthServerConfig.addTokenEndpointAuthenticationFilter( new RetrieveTraceIdFilter() );
}

NOTES:

  • this filter is a servlet filter: inside this filter you MUST call the next item in the chain
  • ... yes, this is NOT how you set up the WebSecurityConfigurerAdapter thing, where you addFilterAfter or such

See also