Solution:
I think WordPress don’t let you to do this because of missing security nonce or referrer page.
My suggestion is to install/develop a plugin that supports remote login and then send the login request to your website based on the plugin structure.
You can use following function for auto login
function auto_login( $username ) {
// log in automatically
if ( !is_user_logged_in() ) {
$user = get_userdatabylogin( $username );
$user_id = $user->ID;
wp_set_current_user( $user_id, $user_login );
wp_set_auth_cookie( $user_id );
do_action( 'wp_login', $user_login );
}
}
Then what you need is to just call it as following:
auto_login('admin');
Hope it helps.