Package jenkins.security
Class SecurityListener
- java.lang.Object
-
- jenkins.security.SecurityListener
-
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
LastGrantedAuthoritiesProperty.SecurityListenerImpl
,UserSeedSecurityListener
public abstract class SecurityListener extends Object implements ExtensionPoint
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
Constructors Constructor Description SecurityListener()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
authenticated(UserDetails details)
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
loggedIn(String username)
Fired when a user has logged in.protected void
loggedOut(String username)
Fired when a user logs out.protected void
userCreated(String username)
-
-
-
Method Detail
-
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
@Deprecated protected void authenticated(@NonNull UserDetails details)
-
failedToAuthenticate
protected void failedToAuthenticate(@NonNull String username)
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:
authenticated2(org.springframework.security.core.userdetails.UserDetails)
-
loggedIn
protected void loggedIn(@NonNull String username)
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
protected void userCreated(@NonNull String username)
- Parameters:
username
- the user- Since:
- 2.161 Fired after a new user account has been created and saved to disk.
-
failedToLogIn
protected void failedToLogIn(@NonNull String username)
Fired when a user has failed to log in. Would be called afterfailedToAuthenticate(java.lang.String)
.- Parameters:
username
- the user
-
loggedOut
protected void loggedOut(@NonNull String username)
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
@Deprecated public static void fireAuthenticated(@NonNull UserDetails details)
- Since:
- 1.569
-
fireUserCreated
public static void fireUserCreated(@NonNull String username)
- Since:
- 2.161
-
fireFailedToAuthenticate
public static void fireFailedToAuthenticate(@NonNull String username)
- Since:
- 1.569
-
fireLoggedIn
public static void fireLoggedIn(@NonNull String username)
- Since:
- 1.569
-
fireFailedToLogIn
public static void fireFailedToLogIn(@NonNull String username)
- Since:
- 1.569
-
fireLoggedOut
public static void fireLoggedOut(@NonNull String username)
- Since:
- 1.569
-
-