Integrating wordpress and laravel user management

2019-07-07 08:16发布

I am developing both a blog with wordpress and a rather complex application with laravel. The problem is to integrate one in the other. I do not want the users to need to log into both services seperately. As I need to store more information about a user than just the wordpress basics I want to use Eloquent and everything from Laravel though.

I could include the Wordpress core and just use the wordpress authentication, but that would mean to load the whole WP environment everytime, if I am not mistaken.

I could also imagine to build some kind of API that allows one system to be able to retrieve the logged in user from the other application, but I have no idea how to build this.

Are there any common ways to solve this problem I have not stumbled upon?

3条回答
SAY GOODBYE
2楼-- · 2019-07-07 09:03

The Hampel plugin uses wordpress as your authority, if you want to do it the other way around and use laravel or any other database as your authority you can swap out Wordpress authentication as described here

This has already been turned into a Wordpress plugin and is available here.

查看更多
乱世女痞
3楼-- · 2019-07-07 09:06
狗以群分
4楼-- · 2019-07-07 09:10

https://wordpress.org/plugins/oauth2-provider/faq/ works like a dream you can either use jquery or php to initiate the cleint

查看更多
登录 后发表回答