json - Access Wordpress User data to login/register through App REST -
i developing mobile application using ionic framework e-commerce website developed using woocommerce.
i need use single database users, registered users can access profiles , non-registered users can register website / app simultaneously same credentials.
i found awesome plugin claims provide rest user data login/register unable use using reactor core , wp-api access products data , wordpress wouldn't allow me use these plugins simultaneously.
well wordpress self has communication protocol xml-rpc can read more on here, not have authentication method builtin.
but can try thing this:
function mynamespace_getuserid( $args ) { global $wp_xmlrpc_server; $wp_xmlrpc_server->escape( $args ); $blog_id = $args[0]; $username = $args[1]; $password = $args[2]; if ( ! $user = $wp_xmlrpc_server->login( $username, $password ) ) return $wp_xmlrpc_server->error; return $user->id; } function mynamespace_new_xmlrpc_methods( $methods ) { $methods['mynamespace.getuserid'] = 'mynamespace_getuserid'; return $methods; } add_filter( 'xmlrpc_methods', 'mynamespace_new_xmlrpc_methods');
you can read more on extending xml-rpc here. if using client side language authentication, can check wordpress xmlrpc javascript api
Comments
Post a Comment