Package jenkins.security
Class SecurityListener
java.lang.Object
jenkins.security.SecurityListener
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
LastGrantedAuthoritiesProperty.SecurityListenerImpl
,UserSeedSecurityListener
Listener notified of various significant events related to security.
- Since:
- 1.548
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
authenticated
(UserDetails details) Deprecated.protected void
authenticated2
(org.springframework.security.core.userdetails.UserDetails details) Fired when a user was successfully authenticated using credentials.protected void
failedToAuthenticate
(String username) Fired when a user tried to authenticate but failed.protected void
failedToLogIn
(String username) Fired when a user has failed to log in.static void
fireAuthenticated
(UserDetails details) static void
fireAuthenticated2
(org.springframework.security.core.userdetails.UserDetails details) static void
fireFailedToAuthenticate
(String username) static void
fireFailedToLogIn
(String username) static void
fireLoggedIn
(String username) static void
fireLoggedOut
(String username) static void
fireUserCreated
(String username) protected void
Fired when a user has logged in.protected void
Fired when a user logs out.protected void
userCreated
(String username)
-
Constructor Details
-
SecurityListener
public SecurityListener()
-
-
Method Details
-
authenticated2
protected void authenticated2(@NonNull org.springframework.security.core.userdetails.UserDetails details) Fired when a user was successfully authenticated using credentials. It could be password or any other credentials. This might be via the web UI, or via REST (using API token or Basic), or CLI (remoting, auth, ssh) or any other way plugins can propose.- Parameters:
details
- details of the newly authenticated user, such as name and groups.- Since:
- 2.266
-
authenticated
-
failedToAuthenticate
Fired when a user tried to authenticate but failed. In case the authentication method uses multiple layers to validate the credentials, we do fire this event only when even the last layer failed to authenticate.- Parameters:
username
- the user- See Also:
-
loggedIn
Fired when a user has logged in. Compared to authenticated, there is a notion of storage / cache. Would be called afterauthenticated2(org.springframework.security.core.userdetails.UserDetails)
. It should be called after theSecurityContextHolder.getContext()
's authentication is set.- Parameters:
username
- the user
-
userCreated
- Parameters:
username
- the user- Since:
- 2.161 Fired after a new user account has been created and saved to disk.
-
failedToLogIn
Fired when a user has failed to log in. Would be called afterfailedToAuthenticate(java.lang.String)
.- Parameters:
username
- the user
-
loggedOut
Fired when a user logs out.- Parameters:
username
- the user
-
fireAuthenticated2
public static void fireAuthenticated2(@NonNull org.springframework.security.core.userdetails.UserDetails details) - Since:
- 2.266
-
fireAuthenticated
- Since:
- 1.569
-
fireUserCreated
- Since:
- 2.161
-
fireFailedToAuthenticate
- Since:
- 1.569
-
fireLoggedIn
- Since:
- 1.569
-
fireFailedToLogIn
- Since:
- 1.569
-
fireLoggedOut
- Since:
- 1.569
-
authenticated2(org.springframework.security.core.userdetails.UserDetails)