Integration with Wordpress authentication

2

Considering a Wordpress-based site and a management system that runs in the same domain, but with fully independent authentication features, I think of integrating Wordpress authentication with the management system, that is, by logging in to Wordpress , I will automatically access the management system through a link in the Wordpress menu itself.

My need is to have the user data available in the management system, such as id, name, surname among others.

If a user tries to access some restricted internal page of the management system without authenticating, the system should redirect it to Wordpress authentication.

I would like ideas for this integration and technical implementation ideas.

    
asked by anonymous 02.10.2014 / 05:16

2 answers

3

You can point the wp_user and wp_usermeta tables to others in the same DB using the following constants in wp-config.php :

define( 'CUSTOM_USER_TABLE', $table_prefix.'my_users' );
define( 'CUSTOM_USER_META_TABLE', $table_prefix.'my_usermeta' );

The point is that these other tables must have the same structure as WP :

Related: Make website login work on WordPress too and SSO / authentication integration with external 'directory service' .

    
02.10.2014 / 17:18
3

I refer to my experience in a solution that I worked on. In my specific case the authentication system was independent of Wordpress and the management system. In Wordpress a plugin built for the effect authenticates the user in the authentication system and in the management system the same thing happened.

After successful authentication some of the user fields were updated in Wordpress as it is necessary for some plugins that you can install that will require some of that user information not to mention Wordpress itself.

The separate authentication system has many advantages because it separates the services and puts specialization in each of the services. It can also centralize credentials for many other benefits.

Using WebServices and managing TOKENS for example, it was possible manage users' actions so that they only authenticate once, even though they use the various services available.

    
02.10.2014 / 10:39