Skip to content

Commit a443126

Browse files
dmitrilcjzheaux
authored andcommitted
Update oauth2-resourceserver.adoc
fix the name of the parameter, from failure to badCredentials Replaces AuthenticationFailureEvent Remove AuthenticationFailureEvent Reference Closes gh-10062
1 parent 36454d3 commit a443126

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: docs/manual/src/docs/asciidoc/_includes/servlet/authentication/events.adoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[servlet-events]]
22
== Authentication Events
33

4-
For each authentication that succeeds or fails, a `AuthenticationSuccessEvent` or `AuthenticationFailureEvent` is fired, respectively.
4+
For each authentication that succeeds or fails, a `AuthenticationSuccessEvent` or `AbstractAuthenticationFailureEvent` is fired, respectively.
55

66
To listen for these events, you must first publish an `AuthenticationEventPublisher`.
77
Spring Security's `DefaultAuthenticationEventPublisher` will probably do fine:
@@ -42,7 +42,7 @@ public class AuthenticationEvents {
4242
}
4343
4444
@EventListener
45-
public void onFailure(AuthenticationFailureEvent failures) {
45+
public void onFailure(AbstractAuthenticationFailureEvent failures) {
4646
// ...
4747
}
4848
}
@@ -70,7 +70,7 @@ While similar to `AuthenticationSuccessHandler` and `AuthenticationFailureHandle
7070

7171
=== Adding Exception Mappings
7272

73-
`DefaultAuthenticationEventPublisher` by default will publish an `AuthenticationFailureEvent` for the following events:
73+
`DefaultAuthenticationEventPublisher` by default will publish an `AbstractAuthenticationFailureEvent` for the following events:
7474

7575
|============
7676
| Exception | Event
@@ -97,7 +97,7 @@ To that end, you may want to supply additional mappings to the publisher via the
9797
public AuthenticationEventPublisher authenticationEventPublisher
9898
(ApplicationEventPublisher applicationEventPublisher) {
9999
Map<Class<? extends AuthenticationException>,
100-
Class<? extends AuthenticationFailureEvent>> mapping =
100+
Class<? extends AbstractAuthenticationFailureEvent>> mapping =
101101
Collections.singletonMap(FooException.class, FooEvent.class);
102102
AuthenticationEventPublisher authenticationEventPublisher =
103103
new DefaultAuthenticationEventPublisher(applicationEventPublisher);

Diff for: docs/manual/src/docs/asciidoc/_includes/servlet/oauth2/oauth2-resourceserver.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3038,7 +3038,7 @@ Additionally, it is published as an `AuthenticationFailureBadCredentialsEvent`,
30383038
@Component
30393039
public class FailureEvents {
30403040
@EventListener
3041-
public void onFailure(AuthenticationFailureEvent failure) {
3041+
public void onFailure(AuthenticationFailureBadCredentialsEvent badCredentials) {
30423042
if (badCredentials.getAuthentication() instanceof BearerTokenAuthenticationToken) {
30433043
// ... handle
30443044
}

0 commit comments

Comments
 (0)