Adding a “Sign In/My Account” link to an external app

You can read cookies both on the front- and back-end sides. For the front-end, you have to provide both links, and show only the desired one with javascript. Use document.cookie.indexOf(‘cookie_name’) to check the cookie presence. For the back-end, you can read the special $_COOKIE variable to check the cookie presence in you template and change … Read more

Authentication over CURL

I figured out the answer myself and I’ll post it here in case anyone else has this problem. Basically in WP 3.9.1, wp_insert_post() checks the current logged in user for account capabilities (at least this is what I assume). Since I was connecting over cURL, there is no logged in user so the capability checks … Read more

How to add additional factor to wordpress authentication

I don’t know that I would use cookies for this as the user could just modify their cookie to match their current IP. You could store the user’s IP as user meta at signup and then compare that to their IP during subsequent logins via the wp_authenticate_user filter. Sample code (untested): add_action( ‘user_register’, ‘wpse157630_add_user_ip’, 10, … Read more