$_SESSION variables lost during OAuth callback

With my version of wordpress there is NO session. So when I call $_SESSION[‘callback_state’]=stuff it’ll gladly save it to a temporary stack local variable instead of with the actual session. So before you redirect do: if (!session_id()) {session_start();} //then the normal redirect header(“location: $newUrl”); exit(0);

How to build a plugin that supports authenticated POST requests to the REST API from external servers?

Answering my own question. For plugin developers, the directive is to use current_user_can() in your code as usual in the REST endpoints, as Core does. WordPress 5.4 does not support authenticated requests originated from outside WordPress to the REST API yet. But your clients can use plugins such as Basic Auth, OAuth2 or JWT to … Read more

Implement authentication to an organization oAuth server

Using JWT you can extends the WP REST API using JSON Web Tokens Authentication as an authentication method. WordPress REST API Authentication: Default cookie authentication : cookie authentication is the only authentication mechanism available natively within WordPress. Remote applications : To support remote applications, we need to add a new REST API authentication method using … Read more

How do I use the WP REST API plugin and the OAuth Server plugin to allow for registration and login?

I know it’s a bit far fetched, but might help. For anyone looking for WP REST API implementation with JWT, here’s our solution. Add it to your function.php add_action(‘rest_api_init’, ‘wp_rest_user_endpoints’); /** * Register a new user * * @param WP_REST_Request $request Full details about the request. * @return array $args. **/ function wp_rest_user_endpoints($request) { /** … Read more