Title: Plugin API/Filter Reference/authenticate
Last modified: February 16, 2017

---

# Plugin API/Filter Reference/authenticate

 *  [Dave Navarro, Jr.](https://wordpress.org/support/users/dnavarrojr/)
 * (@dnavarrojr)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/plugin-apifilter-referenceauthenticate/)
 * [https://codex.wordpress.org/Plugin_API/Filter_Reference/authenticate](https://codex.wordpress.org/Plugin_API/Filter_Reference/authenticate)
 * Apparently thing filter is called AFTER WordPress does it’s basic authentication
   process.
 * I can’t seem to find a filter that allows me to REPLACE the WordPress authentication
   process. I don’t want WordPress to do any authentication of any kind. I want 
   to replace the entire login process with my own.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Luis Sacristán](https://wordpress.org/support/users/displaynone/)
 * (@displaynone)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/plugin-apifilter-referenceauthenticate/#post-8813823)
 * Hi
 * Perhaps you should use login_init action, it is called before any WP login process.
 * Hope it helps you
 *  Thread Starter [Dave Navarro, Jr.](https://wordpress.org/support/users/dnavarrojr/)
 * (@dnavarrojr)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/plugin-apifilter-referenceauthenticate/#post-8813905)
 * Thanks Luis. login_init is fired after the form is rendered. What I want is to
   capture the process after the form is submitted, but BEFORE WordPress does anything
   else.
 *  [Luis Sacristán](https://wordpress.org/support/users/displaynone/)
 * (@displaynone)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/plugin-apifilter-referenceauthenticate/#post-8813948)
 * Perhaps you can use this filter: ‘login_url’ you change the login url and use
   your own login process
 *  Thread Starter [Dave Navarro, Jr.](https://wordpress.org/support/users/dnavarrojr/)
 * (@dnavarrojr)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/plugin-apifilter-referenceauthenticate/#post-8813994)
 * Actually, what I’ve been looking for is the `wp_authenticate` hook.
 * [https://codex.wordpress.org/Plugin_API/Action_Reference/wp_authenticate](https://codex.wordpress.org/Plugin_API/Action_Reference/wp_authenticate)
 * That allows me to completely replace the authentication process with my own.
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/plugin-apifilter-referenceauthenticate/#post-8814742)
 * > wp_authenticate hook… allows me to completely replace the authentication process
   > with my own.
 * While that may appear to be the case, it really isn’t. The original authentication
   process still proceeds. As long as your process manages to set the auth cookie
   before the default process gets around to checking for it, all’s good. In some
   situations this may not be the case. This is not a 100% reliable method.
 * The proper way to implement your own authentication is through the “authenticate”
   action you originally looked at. You haven’t fully considered the possibilities
   here. One is you can remove the default authenticate hook(s) and place your own.
   Another is to simply hook with a small priority number so your callback executes
   before the default. As long as your callback returns either a WP_User or WP_Error
   object, the default process will honor your findings and pass the object through
   unchanged (it might add another error message, but it’s the same error instance).
 * Even if you hooked later after the user is authenticated by the default process,
   you can override it by simply returning a WP_Error object instead. No auth cookie
   is set in this process. It’s not set until all callbacks have had a chance to
   influence the process. Any one callback can override the previous ones, so it’s
   actually beneficial to hook very late with a large priority so your callback 
   has the final say.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Plugin API/Filter Reference/authenticate’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 5 replies
 * 3 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/plugin-apifilter-referenceauthenticate/#post-8814742)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
