-3

We have an in-house SSO login plugin. This plugin auto logs in users via SSO - they never see a login page.

We were able to use the "Logout" url to get to the manual login of a user before but with recent WP core updates this no longer works. So wondering how to create a duplicate login page that does NOT use any plugins?

Is a better way to say this question - is there a WP hook that allows you to manually remove plugins from a core page?

  • 1
    I'm confused, are you trying to remove a login from core, create a custom login page, or log out the user? Could we have an example please? – Jack Johansson Aug 25 '17 at 3:28
  • Your question is confusing please make it in some brief. – maulik Aug 25 '17 at 6:29
  • 2
    "Is there a WP hook that allows you to manually remove plugins from a core page?" What ??? – ClemC Aug 25 '17 at 11:36
  • 1
    downvoted as obviously an good answer will depend on what plugins you use and how they interact with the login process. Actually not sure why writting a new login page is something that even requires asking here, just have a form with user and password and do whatever core does after authentication – Mark Kaplun Aug 26 '17 at 13:39
  • 1
    I think you need to clarify your question more please. – Greeso Aug 26 '17 at 18:48
3
+25

This question is confusing because we don't know exactly what you are ultimately trying to accomplish, but I will attempt to give an answer for what I might do to answer what I think you are asking:

We have an in-house SSO login plugin. This plugin auto logs in users via SSO - they never see a login page.

Sounds good. This might be the clearest part of your question.

We were able to use the "Logout" url to get to the manual login of a user before but with recent WP core updates this no longer works.

I don't understand how you would use the logout url to get to the manual login of a user. Unless you are trying to say that you could "Log out" and that would take you to a login screen (which kinda defeats the idea of "never seeing a login page".) Wordpress gives you a login url with the function wp_login_url() but this page is not visible for people who are logged in --> logged in users are redirected away because they don't need to log in.

So wondering how to create a duplicate login page that does NOT use any plugins?

This question completely counteracts your first statement. Unless you are instead asking about making a page where your SSO login plugin is not utilized. If this is the case (you want to make your SSO login plugin selectively load), then you can use a custom page template, category, or some other designation for pages where you don't want it active, then reprogram your SSO login plugin to not load when pages use that custom template, category, etc.

Is a better way to say this question - is there a WP hook that allows you to manually remove plugins from a core page?

Not that I know of. You might be able to hack a solution with an MU plugin of your own that loads before all other plugins, but there are plenty of better ways to accomplish almost anything without trying to manually remove plugins from a core page.


Unless I misunderstand what you are wanting to accomplish, I would write a simple "helper" plugin (or modify your SSO plugin) that checks if a user is logged out then validates them with the SSO if they are not currently logged in. This way, when they first hit the home page of your site (or any page), they are immediately authenticated and logged in -- even if the home page doesn't show anything customized to them specifically.

If you want to program a way to "change users", then you could have the plugin always authenticate the current user of the SSO system (instead of simply trying to authenticate only logged out users) and that way if the user changes via your SSO system, the logged in user would automatically change with the next load of a website page.

--Or--

You could program your SSO plugin (or helper plugin) to check for a specific string in the url (via Get) and then use that to force a re-authentication process. (i.e. mysite.com/?reauth=1 --> $_GET["reauth"] == 1 would trigger the SSO plugin to log-out the current user and log in a new one via SSO if present.)

This would give you the goal of never showing the login page, but allow you to be able to switch users either automatically or manually via a special link.

Again, I think this answers what you are asking, but if not, then let us know.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.