Authentication and external redirection to wordpress sites

Asked

Viewed 326 times

3

I’m creating a simple login system that redirects a customer to their area. There will contain links to your projects, IE, when clicking, it will be redirected to your site.

EXAMPLE: I have a folder called customer web sites in this hierarchy:

sites_clientes
       cliente_1
        -worpress1
        -worpress2
        -worpress3

       cliente_2
        -worpress1
        -worpress2

All customers will have access to sites_clientes for authentication.

DOUBT: Which file, from the root folder of WORDPRESS, should use conditions with $_SESSION for authentication?

  • You want to authenticate the user in wordpress?

  • No. I have already done it externally. Authentication is on sites_clientes

  • I don’t understand what you want to do.

  • You want to do a kind of Single Sign On? The user has logged on to the main Wordpress and, when redirected to another, it should already be authenticated?

  • @utluiz, is the following: I entered in www.meusistema.com.br(IS NOT WORDPRESS), filled in my user and password and WAS REDIRECTED TO MY www.meusistema.com.br/wordpress.

1 answer

2


A way to automatically authenticate a user in Wordpress is through the method wp_authenticate() of the API.

When the user logs into the main site, you need to give a include in Wordpress and run the call by passing user and user password in Wordpress.

Note that you need to have its data on your main system, but how to get it will depend on how the installation is set up.

There are other ways to get the same effect, but this is the least intrusive. Alternatives include using a plugin or override the authentication method.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.