Skip to content
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

SecurityIdentityAssociation's identity not set by event fired from Undertow #15006

Closed
blxbrgld opened this issue Feb 11, 2021 · 3 comments
Closed
Labels
area/security kind/bug Something isn't working
Milestone

Comments

@blxbrgld
Copy link

Hello,

our application performs authentication with the servlet spec (HttpSerlvletRequest.login) and we faced the following issue when we tried to upgrade from 1.10.3.Final to 1.11.2.Final:

by fixing issue/13835 SecurityIdentityAssociation does not observe SecurityIdentity events anymore (here), so the event fired by the UndertowDeploymentRecorder here never ends up setting the security identity.

I believe that the UndertowDeploymentRecorder does not need to fire the event anymore and instead it just has to set the SecurityIdentityAssociation's identity via CDI.

The proposed fix can be found here.

@blxbrgld blxbrgld added the kind/bug Something isn't working label Feb 11, 2021
@ghost ghost added the area/security label Feb 11, 2021
@ghost
Copy link

ghost commented Feb 11, 2021

/cc @sberyozkin

@CurtisBaldwinson
Copy link

I'm not sure if it was a bug or not but I had a similar problem.

In my Filters class I injected the following SecurityIdentityAssociation:

    @Inject @RequestScoped
    SecurityIdentityAssociation delegateSecurityIdentityAssociation;

Then after grabbing the user information, I set the identity like so inside the @ServerRequestFilter:

                delegateSecurityIdentityAssociation.setIdentity(
                        new SecurityIdentity() {
                            @Override
                            public Principal getPrincipal() {
                                return response::toString;
                            }
... etc. etc. more methods to override

SecurityIdentity has a bunch of methods you'll need to override, which your IDE should help you generate.

@gsmet
Copy link
Member

gsmet commented Feb 15, 2021

Has been fixed by #15005 .

@gsmet gsmet closed this as completed Feb 15, 2021
@gsmet gsmet added this to the 1.12.0.Final milestone Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/security kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants