SAML SP Premium Plugin Hooks Documentation


WordPress Hooks


WP Actions

1. user_register

do_action( 'user_register', string $user_id );

Description
 Fires when a new user is registered on WordPress during Single Sign-On (SSO). This action allows you to perform tasks immediately after a user is registered on the site.

Parameters

  • $user_idstring
    User ID

2. wp_login

do_action( 'wp_login', string $user_login, WP_User $user );

Description
 Fires after the user is successfully logged in via Single Sign-On (SSO). This allows you to perform actions just after a user is logged in to the site.

Parameters

  • $user_loginstring
    Username
  • $userWP_User
    WP_User object of the logged-in user.

WP Filters

1. pre_user_login

apply_filters( 'pre_user_login', string $sanitized_userName );

Description
 Fires just before the user’s username is searched in WordPress for login. This allows you to modify the username (received from the SAML Response) before user login or register.

Parameters

  • $sanitized_userNamestring
    Sanitized Username

Custom Hooks


Actions

1. mo_abr_filter_login

do_action( 'mo_abr_filter_login', array $attrs, string $nameId, string $sessionIndex )

Description
 Fires just before the user is logged in to WordPress via SSO. This allows you to perform actions before the user has logged in and also provides all the user attributes received from the IDP.

Parameters

  • $attrsarray
    Contains an array of attributes received from the IDP in the SAML Response.
  • $nameIdstring
    NameId received from the IDP.
  • $sessionIndexstring|NULL
    The session index of the user on the WP site.

2. mo_saml_attributes

do_action( 'mo_saml_attributes', string $user_name, string $user_email, string $first_name, string $last_name, string $group_value );

Description
 Fires after a user is created/updated in WordPress for SSO. This allows you to perform actions after the user has logged in and also provides the basic user attributes received from the IDP.

Parameters

  • $userNamestring
    User's Username
  • $user_emailstring
    User's Email
  • $firstNamestring
    User's First Name
  • $lastNamestring
    User's Last Name
  • $groupNamestring
    User's Group Name

Filters

1. mo_remember_me

apply_filters( 'mo_remember_me', boolean $remember );

Description
 Fires just before setting the WP authentication cookie. This enables you to maintain user login status by keeping the session intact (passing remember me as true).

Parameters

  • $rememberboolean
    The value of the remember me checkbox from the login page.

2. mo_saml_add_custom_css_in_sso_button

apply_filters( 'mo_saml_add_custom_css_in_sso_button', $html );

Description
 Fires just before the SSO Login Button is loaded on the WordPress login page. This allows you to customize the SSO Login button.

Parameters

  • $htmlHTML body
    The current html element of the SSO button as saved in the plugin settings.