Solved

bbPress Automatic Login

Posted on 2012-12-20
3
565 Views
Last Modified: 2013-01-02
I need to develop a Wordpress site that will use an external user database. I've done this before by creating a custom login/registration page and using standard PHP sessions. The only problem now is that I also need to integrate with bbPress. I need to be able to do 2 things:

When a user logs in via my custom login page, that user should then also be authenticated to use the bbPress forums.

When an active, valid PHP session exists, but a bbPress session does not (for example, if the bbPress session expires before the PHP session), I need the bbPress session to be created.

Can anyone help me with this, point me in the right direction, or give me some kind of starting point?

Much appreciated!
0
Comment
Question by:Julian Matz
3 Comments
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 300 total points
ID: 38711509
This is not really an "answer" but it goes in the direction that other sites are using.  Consider using OAuth.  I recently joined StackExchange, and it looks like that is what they are using.  It plays well with Gravatar and similar sites, so it might work for your needs.
0
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 200 total points
ID: 38711700
There is also a (largely abandoned but still functional) WordPress plugin that allows it to use an external database for authentication. This is superior to using the standard PHP sessions because you would get the benefit of passing the user over to bbPress with only minimal coding gymnastics.

http://wordpress.org/extend/plugins/external-database-authentication/

OAuth is a possibility but you would be having to write a bridge from WordPress to bbPress using those credentials.  Same amount of work, I think.
0
 
LVL 21

Author Comment

by:Julian Matz
ID: 38737299
Thanks! I still need to research OAuth a bit more, but it looks like some of the following WordPress functions could come in very handy:

wp_create_user( $username, $password, $email )
wp_insert_user( $userdata )
wp_update_user( $userdata )
wp_signon( $credentials, $secure_cookie )
wp_set_auth_cookie( $user_id, $remember, $secure )
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
This article discusses four methods for overlaying images in a container on a web page
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question