It’s better not to do so. And I’m completely against overriding the default authentication mechanism simply because of WordPress and it’s plugins usually are depended on the website’s database.
But if you’re really into this situation WordPress provides a filter called authenticate
:
add_filter( 'authenticate', 'wpse75679_auth', 30, 3 );
function wpse75679_auth( $user, $username, $password ) {
return $user;
}
Just make sure you’re returning an instance of WP_User
when your authentication is done.
Related Posts:
- how to authenticate for the REST API from a plugin and from command line
- How do I use the WP REST API plugin and the OAuth Server plugin to allow for registration and login?
- What is an Endpoint?
- WordPress Rest API custom endpoint optional param
- Create API for single sign-on with 3rd party site
- Set up WP Authentication from External API
- How do I cache (core) API requests?
- WP REST API only returning partial list of users
- Slow REST API calls on self-hosted WordPress [closed]
- Retrieving pages with multiple tags using REST API
- WordPress API – Get Drafts
- How to stop WP API endpoint from caching?
- How to get the attached gallery in the rest API?
- WP API : date_query parameter
- Authentication/API Questions
- Custom route for WP-API gives “rest_no_route” value
- Get more than 10 posts in a specific category with the wordpress api
- “rest_no_route” – Debug error
- Developing Themes with React/Angular
- Authentication for a mobile app connected via wp-rest api?
- curl POST work with user meta but not the custom user meta
- Implementing the wp json-rest api
- Create post with REST API in php with file_get_contents
- WordPress REST API “rest_authentication_errors” doesn’t work external queries?
- node-wpapi: how to handle authentication?
- How can I cache WordPress Rest API Response
- WordPress REST API always misses parameters – rest_missing_callback_param
- Adding rest api endpoints to an old theme
- Develop REST API using WordPress for Android app [closed]
- Why aren’t tags and categories added in post request to WP Rest API
- Add basic authentication of WordPress on any external PHP file?
- How do I query my WordPress posts on another HTML page using the WordPress Restful API?
- body_class REST field in WP-API
- How to edit feature image with XML RPC?
- WordPress HTTP API NTLM Authentication
- How to add an endpoint for my custom post type? /wp-json/wp/v2/posts is working but it didn’t in the custom post
- WP REST API and Access-Control-Allow-Origin
- Set up WP Authentication from External API
- Working Around rest_forbidden_context
- Secure WordPress API, how?
- register/login api
- rest_cannot_create_user
- Periodically Query an external API on wordpress site
- Extending the API I created to return category names
- Rest WP_Error always return null
- Posting data from Ionic app to WordPress
- Expand author, tags and categories in the WordPress JSON API
- How to display parent category with first level child in REST API
- WordPress REST API Endpoint (Authors and Categories latest posts)
- Why does “if statement” has to “die()”, otherwise wont work?
- Best way to make a JSON API from WordPress?
- REST API And Error Codes – No Message
- How to login via wordpress api and get user details?
- How many users/load can the rest API handle?
- Login and register by API
- How do you get the API key for Locu?
- WP set auth cookie using Ajax is not saved to browser
- WordPress.org Support Forum API
- Connect external web app to wordpress
- How to get all posts (in chunks) via XML-RPC?
- How to add a custom parameter to a WP API default route?
- Cannot edit post meta fields with rest API
- how to get nonce using json api
- How to Hit External REST POST API in WordPress? [closed]
- Options to get my custom post type metadata via the WordPress API
- Limit REST API output to current logged in user that is also author of the content
- Headless WordPress – Issue with plugin path
- Possible to use wordpress as publishing platform but programmatically inject content?
- how to send Ajax request in wordpress backend
- are there any initiatives to work wordpress as microservices?
- WordPress Google Calendar Oath 404
- Store regex expression in WordPress DB using Options API
- WP List Table in custom post type
- Easiest way to call an External rest API?
- Get a remote post ID via API given URL
- Building a REST API for your web app exposes primary keys of DB records?
- How to change the date and time in REST API for comments?
- Sending posts from Python to WordPress
- how to use nimble-API and Display data?
- How to display relations via wordpress Rest API
- How to verify which WordPress user requested the API in ASP .NET Core?
- Get the name WordPress default theme in the core
- Solution for processing lots of data with CRON/API, dealing with memory/timeout issues
- woocommerce api echo out response
- Limit the number of external API calls per second
- WordPress API – Getting just post content
- Login cookies blocked after customizing hashing method
- wc_get_products() return empty object
- How to use following API with WordPress?
- Implementing URL JSON API Data into Website
- REST API get featured image source for custom post type
- REST API Working for GET but not for POST?
- Stop Vimeo video with javascript – inside a loop and using a modal window
- Get full page HTML for a non-public WordPress page
- WordPress SMS API integration without plugin
- Update post / page using API + python
- Social login authentication via wordpress rest api
- Is it possible to create post in wordpress using postman?
- Issue with API after 6.2 update
- Using WordPress API to mass update posts freezes the server