Skip to content

Consider providing setter of authenticationDetailsSource field in BearerTokenAuthenticationFilter #8840

@thecodinglog

Description

@thecodinglog

Expected Behavior

A custom AuthenticationDetailsSource can be injected into BearerTokenAuthenticationFilter.

Current Behavior

The authenticationDetailsSource field is final so it can't.

Context

In order to authenticate with bearer token, I'm writing an AuthenticationManager having authentication logic using Spring Security.
To do this, I have to put additional information into the details of Authentication and change the authenticationDetailsSource field of org.springframework.security.oauth2.server.resource.web.BearerTokenAuthenticationFilter class. But the field is declared as final and forced to use WebAuthenticationDetailsSource class.

I think it may be possible to provide a setter so that a newly defined AuthenticationDetailsSource can be injected from outside, but I am wondering what is forcing it.

Can please you consider providing setter of authenticationDetailsSource field in BearerTokenAuthenticationFilter?

version : spring-security 5.3.2.RELEASE

Metadata

Metadata

Labels

in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions