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
  • 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

      @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:
    • 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 after authenticated2(org.springframework.security.core.userdetails.UserDetails). It should be called after the SecurityContextHolder.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 after failedToAuthenticate(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