Authenticate WordPress Site through another WordPress installation?
Hook into wp_login and use oAuth from the rest-api to validate against the other site. I’m sure keeping the user info the same between the two sites would be tough though
Hook into wp_login and use oAuth from the rest-api to validate against the other site. I’m sure keeping the user info the same between the two sites would be tough though
Logged In cookie gets saved but not Auth cookie
Try… function maybe_auth_redirect() { if ( is_page_template(‘my-template.php’) && ! is_user_logged_in() ) { auth_redirect(); } } add_action(‘template_redirect’, ‘maybe_auth_redirect’); https://developer.wordpress.org/reference/functions/is_page_template
To store user–specific information WordPress has a user meta, pretty much identical to post meta (also known as custom fields). See get_user_meta() and related functions. Unfortunately WP doesn’t provide any interface or interface helpers for it. You would have to implement that yourself, probably hooking into user profile screen.
First, check for get_current_user_id. Then create a log of visits by adding information to a user’s metadata with update_user_meta & get_user_meta. On every page hit that you care about you can run a function to determine rate/limit of usage per user. If they break the rules, you can redirect to a page that doesn’t contain … Read more
This is the correct format for a cookie to expire in one hour (3600 seconds): setcookie(‘rma_member’, true, time() + 3600, COOKIEPATH, COOKIE_DOMAIN); setcookie Expire: The time the cookie expires. This is a Unix timestamp so is in number of seconds since the epoch. In other words, you’ll most likely set this with the time() function … Read more
After cloning my WordPress database to another server, I cannot log in
I found the solution for using below function: function auto_login() { // make sure user is not logged in and “user” was POST’d $username = isset( $_POST[‘user’] )? $_POST[‘user’] : false; if ( ! is_user_logged_in() && $username ){ // load the user by username $user = get_user_by( ‘login’, $username ); if ( $user ) { … Read more
WordPress is not a platform for SSO, and do not include any API to support such a use case. You can develop a JSON end point to validate users, but the work flow you describe will probably not match it.
Random authentication failures on a load balanced WP setup