Configuring WordPress Auth Cookie Expiration

I’m trying to configure the WordPress cookie expiration time, but for some reason it’s not working. I went here: auth_cookie_expiration And put the following hook based on the doc: function init() { // … $expiration = 60; apply_filters( ‘auth_cookie_expiration’, $expiration ); } This code is called from a hook in my plugin’s constructor: add_action( ‘init’, … Read more

What is the purpose of a “Refresh Token”?

I have a program that integrates with the YouTube Live Streaming API. It runs on timers, so its been relatively easy for me to program in to fetch a new Access Token every 50 minutes with a Refresh Token. My question is, why? When I authenticated with YouTube, it gave me a Refresh Token. I … Read more

How to extend expiry time of jwt wordpress token?

I am making Hybrid app with WordPress database in php, I am using JWT WordPress plugin to authenticate users. But token is expiring in almost 20 minutes, I am using following code to extend the expiry time, But it is not working. Any help is appreciate. add_filter( ‘jwt_auth_token_before_sign’, ‘increase_xpirty_time_token’ ); function increase_xpirty_time_token( $token, $user, $aaaa, … Read more

How are people managing authentication in Go? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 2 years ago. Improve this question For those building RESTful APIs and … Read more

Limit REST API output to current logged in user that is also author of the content

https://developer.wordpress.org/rest-api/using-the-rest-api/frequently-asked-questions/#require-authentication-for-all-requests This requires authentication for all reque​sts. add_filter( ‘rest_authentication_errors’, function( $result ) { if ( ! empty( $result ) ) { return $result; } if ( ! is_user_logged_in() ) { return new WP_Error( ‘rest_not_logged_in’, ‘You are not currently logged in.’, array( ‘status’ => 401 ) ); } return $result; }); Now when I add a … Read more