WordPress Multisite with Azure B2C redirect_urls after Login

I can see a few issues with this approach:

  1. If the user doesn’t belong to a site yet, they won’t get redirected correctly because $redirect_url won’t be defined.
  2. If the user belongs to more than 1 site, they will always be redirected to the site with the lowest ID, not necessarily the one they’re trying to log into.

Have you tried any Azure SSO plugins? I built an intranet for a client that uses Azure for employees to log into the site, and we had great results using Single Sign-on with Azure Active Directory (for WordPress). It’s supposed to work with multisite; you’ll just need to make sure it’s configured correctly on each site.