Solved

bbPress Automatic Login

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
get domain with php 7 19
datetime in sql 6 24
echo time from sql to input type="time" 9 17
CSS Logo Problem. 2 7
"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 how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

912 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

21 Experts available now in Live!

Get 1:1 Help Now