Outgoing proxy connection problem

Not sure if this helps, but you can try.. So WordPress’ default HTTP transport is using cURL, and the HTTP class sets the proxy authorization method to CURLAUTH_ANY (see source), which might explain why the Proxy-Authorization: Basic xxxxx… header is missing from the request. And there’s a hook you can try to change the proxy … Read more

WordPress as a OAuth Provider

Okay, after your comments, I think I see what you’re asking but I’m not sure, so I’ll make it as generic as possible. WordPress uses the authenticate filter hook to perform authentication. You can add additional authentication methods by connecting your own functions to this filter. This is an example of an authentication function. This … Read more

Storing Dropbox Authentication?

I’m not familiar with the Dropbox API or their libraries, but most likely you’ll need to write your own session handler to store the session data in your WP DB (or wherever you want, safely) and associate it with your user account. Essentially adusting this line: $storage = new \Dropbox\OAuth\Storage\Session($encrypter);. EDIT: If it’s the WordPress … Read more

How to use WordPress authentication on non-WordPress page?

Just add this at the top of your file: require_once($_SERVER[‘DOCUMENT_ROOT’].’/wp-blog-header.php’); // If you run multisite, you might nees this to prevent 404 error header(‘HTTP/1.1 200 OK’); Note that the file must be in the same folder as your theme. Then you can use is_user_logged_in before executing the rest of the script. If use is not … Read more

Extend WordPress (4.x) session and nonce

Your problem is that you call wp_logout_url immediately after wp_set_auth_cookie. wp_set_auth_cookie() does some setcookie() calls. Unfortunately setcookie doesn’t make the new value available instantly in the PHP global $_COOKIE. It must be set through a new HTTP Request first. wp_logout_url() (via wp_nonce_url > wp_create_nonce > wp_get_session_token > wp_parse_auth_cookie) fetches $_COOKIE[LOGGED_IN_COOKIE] in order to create a … Read more

why does WordPress need two cookies for auth/login

“On login, wordpress uses the wordpress_[hash] cookie to store your authentication details. It’s use is limited to the admin console area, /wp-admin/ After login, wordpress sets the wordpress_logged_in_[hash] cookie, which indicates when you’re logged in, and who you are, for most interface use. WordPress also sets a few wp-settings-{time}-[UID] cookies. The number on the end … Read more