Add "Sign in with Microsoft" button anywhere (shortcode)

Use this guide if you want to add a "Sign in with Microsoft" button to any page or post of your WordPress website (or possibly to the header / footer area).

Before you start

  • You must already have configured the single sign-on capability of the WordPress + Office 365 plugin.
  • You are at least an Author for your WordPress website.

Using the shortcode

You can customize the shortcode as illustrated with the following example.

From this example it follows that the redirection to the Microsoft login URL is invoked by calling window.wpo365.pintraRedirect.toMsOnline(). The shortcode will ensure that the necessary javascript library is loaded beforehand. It’s up to you to change the enclosing HTML template, but please note that any JavaScript tags will be filtered out.

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