Integrating wordpress and laravel user management

喜欢而已 提交于 2019-12-13 15:04:02

问题


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?


回答1:


(If you still need this) Use this library, from Hampel:

https://packagist.org/packages/hampel/wordpress-auth-laravel

Docs and usage available at: https://bitbucket.org/hampel/wordpress-auth-driver-for-laravel.git




回答2:


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:


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



来源:https://stackoverflow.com/questions/23826827/integrating-wordpress-and-laravel-user-management

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!