Developer hooks

Use this guide if you are a developer and would like to build custom integrations with Microsoft Graph or Microsoft 365 services such as SharePoint Online, Yammer, Teams that extend the out-of-the-box functionality already provided by the WordPress + Office 365 plugin.

Before you start

  • You must already have configured the single sign-on and optionally the integration capability of the WordPress + Office 365 plugin.
  • You are an Administrator for your WordPress website.

Hook Arguments Trigger
wpo365/oidc/authenticating The user's preferred username, email address and groups.
Just before the plugin is about the automatically sign-in a user in WordPress that already successfully authenticated (OpenID Connect).
wpo365/oidc/authenticated
The user's WordPress ID. Just after the plugin has automatically signed in a user in WordPress (OpenID Connect).
wpo365/oidc/authenticating The user's preferred username, email address and groups. Just before the plugin is about the automatically sign-in a user in WordPress that already successfully authenticated (SAML 2.0).
wpo365/oidc/params The parameters for the OpenID Connect authorization request.
wpo365/saml/authenticated
The user's WordPress ID. Just after the plugin has automatically signed in a user in WordPress (SAML 2.0).
wpo365/user/creating The user's preferred username, email address and groups. Just before the plugin is about to create a new user in WordPress.
wpo365/user/created
The user's WordPress ID.
Just after the plugin created a new user in WordPress.
wpo365/user/user_login The user's WordPress username Filters the WordPress username (user_login) just before WPO365 will create a new user. Check out this gist for a working example.
wpo365/wpmu/user_added
The blog's ID.
The user's WordPress ID.
Just after a user is added to a subsite of a WordPress Multisite.
wpo365/sync/before
The job's parameters. Just before user synchronization starts.
wpo365/sync/error
The job's parameters.
Whenever an error occurs during user synchronization.
wpo365/sync/user
The user's attributes. Just before user synchronization begins with the processing of a single user.
wpo365/sync/after
The job's parameters.
As soon as user synchronization has finished.
wpo365/aad/params
The parameters for the OAuth token request, the application IID and the authorization URL. Whenever WPO365 is about to request an access token from the oauth2/v2.0/token endpoint.
wpo365/aad/redirect_uri
The configured Redirect URI. Filters the Redirect URI and thus allows developers to change the Redirect URI.

Legacy hooks

wpo365_skip_authentication - After the plugin finished analyzing whether or not authentication for the current request is required.
wpo365_access_token_processed The user's WordPress ID and the access token. Whenever a fresh access token was received.    
wpo365_openid_token_processed The user's WordPress ID, groups and the ID token. Just after the plugin has automatically signed in a user in WordPress (OpenID Connect).

Examples

Rather than providing an extensive documentation for these hooks, developers instead can review the samples provided below in the form of a simple WordPress plugin.

Please note that the developer hooks are provided as is and there is no support offered.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us