Solved

bbPress Automatic Login

Posted on 2012-12-20
3
560 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 108

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
Read about why website design really matters in today's demanding market.
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…
The viewer will learn how to dynamically set the form action using jQuery.

706 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now