Skip to content

Saml2WebSsoAuthenticationFilter ignores the authentication details #7722

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

Closed
horca opened this issue Dec 11, 2019 · 5 comments · Fixed by #10306
Closed

Saml2WebSsoAuthenticationFilter ignores the authentication details #7722

horca opened this issue Dec 11, 2019 · 5 comments · Fixed by #10306
Assignees
Labels
in: saml2 An issue in SAML2 modules status: ideal-for-contribution An issue that we actively are looking for someone to help us with type: enhancement A general enhancement
Milestone

Comments

@horca
Copy link

horca commented Dec 11, 2019

Hello Spring Security team,

Problem

When using the UsernamePasswordAuthenticationFilter we are setting custom authentication details with AuthenticationDetailsSource to be used further down the security chain. Unfortunately, the Saml2WebSsoAuthenticationFilter does not populate the authentication details even though it inherits from AbstractAuthenticationProcessingFilter which allows to define the details source.

Solution

After the Saml2AuthenticationToken is created, populate the details. Afterwards, when creating the Saml2Authentication within the authetication provider, just copy the details over.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 11, 2019
@fhanik fhanik self-assigned this Dec 12, 2019
@fhanik fhanik added in: saml2 An issue in SAML2 modules type: enhancement A general enhancement labels Dec 12, 2019
@fhanik
Copy link
Contributor

fhanik commented Dec 12, 2019

I feel these two issues are related, and one solution could satisfy both
#7465

horca pushed a commit to horca/spring-security that referenced this issue Dec 12, 2019
…thentication details with AbstractAuthenticationProcessingFilter 'authenticationDetailsSource'
@horca
Copy link
Author

horca commented Dec 12, 2019

I'm not really sure if this issue relates to the UserService and AuthenticatedPrincipal... Please see this commit for more information on what I'm trying to achieve (same mechanism as UsernamePasswordAuthenticationFilter).

@fhanik fhanik removed the status: waiting-for-triage An issue we've not yet triaged label Dec 12, 2019
@horca
Copy link
Author

horca commented Dec 16, 2019

Copying the details within the authentication provider is not needed as they are copied inside the ProviderManager

@jzheaux
Copy link
Contributor

jzheaux commented Jun 15, 2020

@horca, thanks for laying out some of the details here. I think it makes sense to have the SAML 2.0 support align with other authentication filters in Spring Security.

Would you be interested in submitting a PR to have the filter set the details object on the Saml2AuthenticationToken instance and have the authentication provider set the details on the Saml2Authentication instance?

@jzheaux jzheaux added the status: ideal-for-contribution An issue that we actively are looking for someone to help us with label Jul 16, 2020
@ghost
Copy link

ghost commented Dec 11, 2020

@jzheaux I would love to give it a try if its open for contribution. Can you please explain litte more on what is the implementation plan?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: saml2 An issue in SAML2 modules status: ideal-for-contribution An issue that we actively are looking for someone to help us with type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants