Support » Plugin: WordPress + Office 365 login » Endless redirect

  • Hello. When you try to log in, if the user is not registered in the admin area, many times redirects to the login Microsoft. As a result, we receive a message that you cannot log in with these credentials. Is there any way to reduce the number of redirects? We can throw off a link to the site, so you can see for yourself.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author wpo365

    (@wpo365)

    Hi @vladislavunterberg Most likely this is caused by WordPress adding an extra redirect, probably as a result of permalink-configuration … I recommend that you try and reproduce the error e.g. with Chrome with F12 Dev Tools > Network tab opened. Make sure you check the Preserve log option. My guess is that you see an extra redirect e.g. from https://www.example.com/wp-admin to https://www.example.com/wp-admin/ … In this case (most likely due to an entry in your .htaccess or similar) the user – when being redirected from Microsoft back to your website – is immediately redirected again once more by your website. When this happens, the ID token will be removed from the request and the plugin never receives the information needed to log in the user. Another reason could be when you allow multiple URLs for the website e.g. https://example.com/ and https://www.example.com/ … In this case the user is most likely signed in for one URL but not for the other …

    On localhost I’m getting the usual WP authorization form, but on the host I get a lot of redirects

    Plugin Author wpo365

    (@wpo365)

    Hi @vladislavunterberg Can you maybe send me an export of the the network traffic logged e.g. with your (Chrome) browser? I believe you know the email address 🙂 But otherwise you can use the contact form on the website https://wwww.wpo365.com/contact/

    I sent log on your email

    Plugin Author wpo365

    (@wpo365)

    @vladislavunterberg Thanks for the log … What I can see is that you try to navigate to WordPress Admin and the plugin then redirects you to Microsoft (which is OK). Then Microsoft redirects you back and the plugin receives the ID token correct. However, since you’re using the free version and probably didn’t manually create a matching user, the plugin sends the user to default login form with an error code (basically telling you to create the user manually or upgrade). However, it seems, from the log, that as soon you hit the login form, you’re being redirected again to Microsoft. This tells me that you’ve probably deleted the entry /wp-login.php from the Pages blacklist. Now the plugin doesn’t understand that /wp-login.php is a page that should be excluded from authencation. In case you cannot stop the loop anymore, you should delete the option wpo365_options from the wp_options table (and re-configure the plugin).

    Plugin Author wpo365

    (@wpo365)

    Hi @vladislavunterberg Any luck resolving this issue?

    Yes, it did. Thanks so much. Indeed, wp-login has been removed from pages blacklist. More precisely wp-login was, but in a slightly different form, changed the setting when migrating from localhost. You’re helping me out a lot.)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Endless redirect’ is closed to new replies.