Auth user from Laravel to Wordpress Database

2020-03-21 10:38发布

问题:

I have a existing site in wordpress. User register only by web (wordpress). How to authenticate user from Laravel to the wordpress DB.

回答1:

There are a lot of ways to do this. You could:

  • Use a custom authentication driver on your Laravel app to use WordPress database. Hampel's package does this.
  • Use a custom authentication provider to authenticate WordPress users. Laravel WP User package can do this, and it also support REST API.
  • Override Laravel's hashing to make WordPress compatible password hashes using Laravel WP Password package. You can read more about this here.
  • Replace WordPress's built-in authentication.
  • Use Auth0.

There are probably still more ways to do this.