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
- This page didn’t load Google Maps correctly. See the JavaScript console for technical details
- This page didn’t load Google Maps correctly. See the JavaScript console for technical details
- Constructing requests with URL Query String in Python
- Yahoo! Finance CSV file will not return Dow Jones (^DJI)
- Is there a developers api for craigslist.org
- How do you get the API key for Locu?
- Postman Resolving “Invalid CORS request” for a POST Request
- How to: Make JWT-authenticated requests to the WordPress API
- How to use OAuth authentication with REST API via CURL commands?
- Using the Rewrite API to Construct a RESTful URL
- WP function/filter for modifying http headers?
- Access WordPress API Outside of WordPress (command-line PHP)
- Query WP REST API v2 by multiple meta keys
- Override user authentication with external credentials
- Fetch All Posts (Including Those Using a Custom Post Type) With WordPress API
- WP REST API no longer supports filter param, so how do I get posts in a custom taxonomy?
- Is there a way to get protected meta fields through any of the available built-in WordPress APIs? (xmlrpc, wp-json)
- WordPress REST API – Permission Callbacks
- What is the best way to get directory path for wp-config.php?
- WordPress JSON output
- Is it safe to fix Access-Control-Allow-Origin (CORS origin) errors with a php header directive?
- External WordPress API
- Why is per_page not working with categories in WP API?
- How to check WordPress website username and password is correct
- WordPress Rest API: How do we validate with our custom API key?
- REST API: How can I restrict a custom post type to only be accessible by authenticated users?
- WP set auth cookie using Ajax is not saved to browser
- How to authenticate custom API endpoint in WooCommerce [closed]
- WordPress REST API call generates nonce twice on every call
- Creating a post with the REST API, curl and oauth returning 401 error
- Should I store external API data in my WP database or keep it as a transient?
- How to Authenticate WP REST API with JWT Authentication using Fetch API
- Sending POST Request from server
- How to implement ERP (Enterprise Resource Planning) into WordPress?
- List Table API – Safe to use?
- authentication issue with rest api – rest_cannot_create
- API integration with WordPress
- Does the REST API (official) support custom post types?
- POST to a REST API from a wordpress form
- How to build a plugin that supports authenticated POST requests to the REST API from external servers?
- Gutenberg internal page link search box
- get WP-API by page id
- WordPress.org Support Forum API
- Sync posts from one WordPress site to another
- Connect external web app to wordpress