-
Notifications
You must be signed in to change notification settings - Fork 6k
Add Generic AuthenticationFilter #6506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@rwinch let me clarify why
the reason is that in case of failed authentication, which was supplied, we should commence same authentication scheme, that was supplied. So probably there is not much sense to separate this interfaces and it might be logical to have one interface for this. |
Thank you for getting the conversation going. I can see value in a generic Filter. However, I think that we need to discuss this with the team as it is a big change for users (it would deprecate a lot of existing Filters). I do like the idea in principal, and it aligns with how the reactive part works. I do think we need to separate the entry point from the supplier. The entry point is typically used to indicate that no authentication/credentials are present so prompt for some credentials so adding a supplier to the entry point seems counter intuitive to me. |
@rwinch thanks, will wait for your response |
In this case I mean the case when we receive invalid credentials, provided with specific so the point is that if we are able to supply authentication from request, then we also should be able to prompt appropriate authentication in response. Maybe |
That is a separate API too. In that case you use an |
yeah, but there was no I can try to think how to split |
@rwinch have you bean able to decide something on
this also needs your response. |
@rwinch can you please provide a feedback, so I can proceed with this task? |
@rwinch , We're quite interested in contributing this work to your project and we believe that many people will benefit from @sbespalov 's changes. Could you please give us an update? Many thanks in advance! Martin |
@rwinch , In addition, we're already using this in our project (Strongbox). It was introduced via strongbox/strongbox#935. We thought we it would be a great idea to improve the Spring Security project with these fixes, which is why @sbespalov extracted this implementation in a pull request that we would like to contribute to you guys. We understand that these changes could cause deprecations of existing code and that if accepted, they may have to be introduced in a future major release. However, we believe this would improve the way things are currently done in Spring Security and would like to continue this conversation and understand:
It would be great to hear your thoughts! Kind regards, Martin |
@rwinch ping, are there any updates on this? :) |
Thanks for the ping everyone. I'm ok with this happening. However, we need to first decide on a design. I'd take a look at how the reactive bits work and model after that. |
@rwinch : Would you mind elaborating on what you mean by that? Are you looking for some diagrams and flow charts, or what? Or, do you need to go over the code again? |
Thanks for reaching out @carlspring! I'd first call dibs on the work (so that others aren't duplicating efforts). I'd then look at how |
@rwinch , Have you had a chance to look at the pull request @sbespalov submitted for this? Do you mean to say that you'll be re-implementing this, or what...? Would you mind outlining your plan, so that we could see how we can help improve the proposed pull request, if necessary? |
My comment was confusing. Sorry for the misunderstanding. First, I did have time to look at the PR. The feedback I provided still stands. The security team doesn't currently have time for this issue. So if you would like to contribute it please use the following steps:
|
@rwinch I am glad we can have this conversation to find a right way implementing proposed feature. Let me provide an outline as you requested:
Please ask if something unclear so I can provide more details. |
@rwinch is it what you expect, or maybe something else needed? |
Unless there is compelling reason, I'd like there to be a one to one mapping with the reactive bits. This means the names should align and methods align. So more concretely, getAuthenticationType() would not exist,
You can do this leveraging the https://github.com/spring-projects/spring-security/blob/master/core/src/main/java/org/springframework/security/authentication/AuthenticationManagerResolver.java[AuthenticationManagerResolver] which also allows looking up the |
ok, so summarizing all there will be following:
@rwinch would you mind if I will create a PR with such implementation? off topic:
seems this is not exactly the same, in terms of reactive we probably will need something like |
Updated member variable references to be prefixed with "this.". Fixed typo in authentication manager resolver error message. Issue: gh-6506
Updated member variable references to be prefixed with "this.". Fixed typo in authentication manager resolver error message. Issue: spring-projectsgh-6506
The proposal is to have generic Authentication filter which will be able to provide single authentication strategy regardless of authentication type.
The Servlet API based authentication process commonly consist of following stages:
Authentication
from request (supply);Authentication
provided then proceed filter chain;Authentication
then try to authenticate it withAuthenticationManager
;Authentication
;AuthenticationEntryPoint
;The first stage, from above, can be done with
AuthenticationSupplier
interface:This issue targets to clarify proper implementation previously suggested within PR #6496.
The text was updated successfully, but these errors were encountered: