• Resolved majordesigns

    (@majordesigns)


    We have the SSO plug-in installed and working but running into an odd issue. Long story short, URLs hit before logging in via SSO redirect back to login/home page. Steps to recreate issue…

    - User given direct URL to access via email, teams, slack, ect. (example: https://[EMPLOYEES-ONLY-WEBSITE].com/about-us/company-boilerplate/)
    
    - User hits URL but not logged and gets redirected to sign in page.  Custom jQuery function clicks the MS Sign in button which takes user to SSO page
    
    - User successfully logs in and gets redirected to the home page.
    
    - Trying to access the original URL after logging in is redirecting them back to sign in page and then home page (SSO is sticking so they don't need to sign in again).
    
    - Any other page is accessible except the page originally clicked on (in this example: https://[EMPLOYEES-ONLY-WEBSITE].com/about-us/company-boilerplate/)

    So the user trying to view the original URL that was sent to them gets stuck in this redirect issue but only when trying to view that original, specific URL (either directly or navigating to it via the websites navigation). If the user tries in a fresh session without hitting the direct URL first and navigates to the page using the websites navigation, the redirect issue doesn’t occur.

    Hope that makes sense. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Marco van Wieren

    (@wpo365)

    Hi @majordesigns

    I think the issue here is that you have added some custom code that apparently is not compatible with WPO365.

    For example, WPO365 by default and without premium addon, does not redirect a user that should authenticate to the login page. Instead, it would send the user always immediately to Microsoft to authenticate.

    In your case the user is apparently always sent to the login page and SSO is initiated from that page by a custom jQuery function clicking the “Sign in with Microsoft” button. In that scenario, however, WPO365 loses the referrer. For WPO365 it is, as if the user navigated to the login page and clicks the “Sign in with Microsoft” button.

    What authentication scenario did you select on the plugin’s Single Sign-on page: Internet or Intranet?

    Are you using any other plugins to prevent access to certain pages for users that didn’t sign in prior to requesting that page?

    Are you using the default /wp-login.php page or a custom URL?

    Thank you for your patience!

    -Marco

    Thread Starter majordesigns

    (@majordesigns)

    That makes sense then cause I have the following in our header.php to ensure no pages are accessed unless the user is logged in…

    if (!is_user_logged_in()) { wp_redirect( '/wp-login.php/');}

    The plugin is set to internet.

    So is there a setting or code I can insert to ensure ALL pages and posts (not concerned with media library) go through the SSO authentication or will switching from internet to intranet fix that up (or will that cause issues with the already existing Azure setup)?

    Thanks again for your help! Very much apprecaited.

    • This reply was modified 11 months, 2 weeks ago by majordesigns.
    Plugin Author Marco van Wieren

    (@wpo365)

    Yes, I recommend you remove that code from the header and instead select the Intranet authentication scenario. See this support article for more details in that regard.

    Hope that helps!

    -Marco

    Thread Starter majordesigns

    (@majordesigns)

    Thanks a bunch Marco. Much appreciated!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Redirecting after hitting specific URL’ is closed to new replies.