How can I integrate wordpress in my website with common authentication?

A website is developed in core PHP with MySQL database. If we want to integrate WordPress with that in such a way that we don’t have to login in wordpress’s wp-login page.
Once we are login in core website, it should automatically login in wordpress.
This mechanism should be applied to admin and front end too.

Related posts

Leave a Reply

1 comment

  1. You can perform this programmatically with PHP:

    require_once( "wordpress/wp-config.php" );
    $user = wp_signon( array(
        "user_login" => "username",
        "user_password" => "password",
        "remember" => true
    ), false );
    
    // see if the call failed
    if( get_class( $user ) == "WP_Error" ) {
        die( "oops- wrong user/pass?" );
    }
    

    It’d be up to you to synchronize or link usernames and passwords with your other system.