Integrate with custom user backend
-
I’ve created a custom user system for a website and am looking for a forum solution; a friend recommended bbPress to me. However, I need to be able to integrate bbPress so I have a single sign-on and registration point.
Searching around, I’ve found that I’ll need to write a plugin that overrides some of the functions in bb-includes/pluggable.php. All right, sure. This is my first time working with bbPress (no WordPress experience either), so I might as well ask those with more experience in case there’s any advice that could make this easier for me.
I manage authentication through a single cookie with a login_key. This is a randomly-generated string of characters that gets stored in the user’s row in the users table. Each time the user signs in, the site generates a new key and stores that in the table and the cookie.
The users table itself contains fields similar to those of bb_users: id, username, email, first_name, last_name, etc. So integration seems to be a matter of getting bbPress to check for my login_key cookie, and if the cookie is valid, load the data from my users table instead of from bb_users. I’m not concerned about registration, profiles or password changes, since those are all handled by the site on a larger level (although if I could disable those parts of bbPress, that would be helpful).
Looking at pluggable.php, I’ll need to override wp_validate_auth_cookie() and bb_current_user() at the very least. Any other guidance?
- You must be logged in to reply to this topic.