Jim.R
Jim.R

Reputation: 743

Setting a custom AuthenticationDetailsSource on the Spring Oauth2 Token Endpoint

We need to set a custom AuthenticationDetailsSource onto the spring OAuth2 /token endpoint to capture some custom headers which our clients must supply.

The security for that endpoint appears to be configured in org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer and I can't see a way of overriding it.

Does anyone know if this is possible, and how?

Upvotes: 0

Views: 1819

Answers (1)

Dave Syer
Dave Syer

Reputation: 58094

There's no "fluent" api for adding authentication details to the client authentication (assuming that's what you mean). You can easily take control of the token endpoint security though if you ditch @EnableAuthorizationServer and just extend AuthorizationServerEndpointsConfiguration directly. Then you can add your own security configuration in the normal Spring Security way with a WebSecurityConfigurerAdapter.

Upvotes: 1

Related Questions