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

Missing authentication failed event publishing, skip of loginFailed logic #1742

Open
mancze opened this issue Jun 25, 2024 · 0 comments
Open

Comments

@mancze
Copy link
Contributor

mancze commented Jun 25, 2024

Expected Behavior

  • Both successful and failed authentication events are published properly when reacitve implementation DefaultReactiveOpenIdTokenResponseValidator is used.
  • Login failed logic is invoked on authentication failures/validation errors.

Actual Behaviour

  1. Not every authentication failure event is properly published.
  2. Login failed logic can be skipped.

Steps To Reproduce

DefaultOauthController expects a non-empty publisher in callback to handle callback response from oauth client to properly process authentication events and to invoke login failed logic. If no authentication response is obtained, plain HttpResponse.status(HttpStatus.UNAUTHORIZED) is returned skipping event publishing and login failed logic:

}).defaultIfEmpty(HttpResponse.status(HttpStatus.UNAUTHORIZED));

However, the reactive implementation returns empty publisher in case of token validation errors. This is because ReactiveJsonWebTokenValidator won't yield a result if the token is invalid. There are several places where this could be a case, for example:

As a consequence, reactive mappings applied on the upstream won't do anything. Eventually empty publisher propagates to the DefaultOauthController#callback which then skips event publishing and login failed logic.

Environment Information

No response

Example Application

No response

Version

4.5.0 (micronaut-security: 4.9.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant