Forum Replies Created

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Marco

    (@qlcvea)

    Hello,

    I refactored the whole file to remove some return values that would cause the template handler to continue to the default template, thus ensuring it never does (when handling an sso_for_azure_ad URL) and always returns appropriate errors instead.

    Plugin Author Marco

    (@qlcvea)

    Hello,

    I have implemented a fix in the new 2.5.2 release of this plugin.

    Plugin Author Marco

    (@qlcvea)

    Hello,

    I can confirm excluding the only URLs that need to be accessible without logging in are the start and callback URLs.

    However, the exact values that need to be excluded may vary depending on whether the “Use rewrites” option is enabled.

    The exact URLs for a particular site are displayed in the plugin’s options page.

    • This reply was modified 10 months, 1 week ago by Marco.
    Plugin Author Marco

    (@qlcvea)

    Hello,
    I have just run a test with my development AAD tenant, which has security defaults enabled, and I was correctly asked for 2FA.
    If a user is already signed in on the AAD side they will not be asked to log in again, which is expected.
    It may be possible to enforce additional restrictions with Conditional Access, if you have access to it.

    Plugin Author Marco

    (@qlcvea)

    Hello,
    the only URLs to unblock for this plugin to work should be those shown in the options page, although they should be allowed to contain additional query parameters.

    Simply unblocking all URLs containing “sso_for_azure_ad” may cause unintentional side effects allowing access to other pages.

    Plugin Author Marco

    (@qlcvea)

    Hello,
    users that log in through this plugin skip the WordPress login system. This is intentional.
    2FA can be enforced through Azure AD / Entra ID.

    Plugin Author Marco

    (@qlcvea)

    Hello, I was planning on testing the Force Login plugin before replying, but if it allows for exceptions to be created, then adding exceptions for both the Start and Callback URLs may make login work.

    Plugin Author Marco

    (@qlcvea)

    Hello,

    I did not close the original topic and I cannot find a way to reopen it. It was probably closed automatically after some inactivity.

    I did attempt to implement a solution for this issue by adding the “Use POST callbacks” and “Require POST to Start URL” options. Enabling both of these may solve the issue.

    Plugin Author Marco

    (@qlcvea)

    Hello,

    this plugin adds the ability to sign in to WordPress with an Azure AD login. Adding functionality to lock the entire website behind the AAD login is out of scope for this plugin.

    After a search I was able to find some plugins that require the user to log in before being able to access the site (I won’t name any here because I haven’t tried them and therefore cannot vouch for them).

    If the plugin redirects the user to the regular wp-login.php page the “Login with Azure AD” button will appear, allowing login with AAD. This plugin matches AAD users to WordPress users and logs them in with the latter, therefore any plugin that expects a visitor to be signed into WordPress will see the user as “signed in” if they have logged in with AAD through this plugin.

    Plugin Author Marco

    (@qlcvea)

    Hello, I installed the plugin on a new WordPress installation running on PHP 7.0 and did not notice issues with this plugin. If something does not work, could you please provide me with a precise error message?

    This plugin does not generate any alerts or other notifications about PHP versions. Newer versions of WordPress will show alerts if running on PHP < 7.4, but that has nothing to do with this plugin.

    Plugin Author Marco

    (@qlcvea)

    I was referring to the regular WordPress login cookies.

    This plugin does not use cookies itself, instead it uses WordPress’ nonce feature, which relies on an IP address for logged out users and a login cookie for logged in users.

    If a user is already logged in when they start the SSO process (i.e. visiting the /sso_for_azure_ad/start/ or ?sso_for_azure_ad=start URLs shown in the plugin settings) then there may be issues if WordPress cookeis are set to SameSite=Strict, since the user would be issued a nonce tied to their login cookie, but their browser would not present that cookie to WordPress when getting redirected from the Microsoft login page back to the plugin callback page, which would then cause nonce validation to fail.

    Plugin Author Marco

    (@qlcvea)

    I’m sorry, unfortunately I can’t reproduce the problem. Out of your plugin list, only Allow Multiple Accounts and NinjaFirewall stand out to me as potentially being able to cause issues, although I do not know how that could happen.

    Plugin Author Marco

    (@qlcvea)

    The state parameter looks correct, however I am having trouble reproducing the issue.

    The login process relies on WordPress nonces, which get invalidated after logging in or when changing IP address.
    Therefore, I see three possible ways to cause this issue:

    • The user’s IP address changes between when the plugin redirects them to Microsoft for login and when they return; or
    • The user is already logged in and uses the “Homepage / Login URL” in the plugin settings to access the site (for example, form the Office.com homepage) and login cookies are set to SameSite=Strict, which means they won’t be presented by the browser to the website when returning from Microsoft.
    • The user logs in in another tab or window during the portion of the login process that takes place on Microsoft’s website.

    I realize these scenarios are very unlikely. I was unable to come up with other options to trigger this error.

    A list of other plugins in use may be helpful to attempt to replicate the error.

    Plugin Author Marco

    (@qlcvea)

    Hello,

    this error message appears when the “state” parameter in the callback URL is incorrect.

    The parameter value is generated by the plugin and should be relayed as-is by Microsoft after login is complete, so it is either not being generated properly or it is getting mangled in transit somehow.

    For troubleshooting, could you send the portion of the callback URL (the URL of the page where the error appears) between “state=” and the next “&” symbol?

    • This reply was modified 3 years, 2 months ago by Marco.
    Plugin Author Marco

    (@qlcvea)

    If the URLs I previously mentioned are correctly being rewritten to be handled by WordPress I honestly do not have any ideas on why it does not work.

    I might test my plugin again in the next few days on the latest WordPress to ensure that it did not break in a way that I missed.

Viewing 15 replies - 1 through 15 (of 19 total)