Skip to:
Content
Pages
Categories
Search
Top
Bottom

WordPress/BBPress Single Sign On


  • schmitt
    Member

    @schmitt

    I’ve read through multiple posts about WordPress/BBpress integration but cannot find the answer to one question.

    Is single sign on supported?

    I understand that the same username and password is shared between the two sites, but if I log into WordPress do the same cookies automatically log me into BBpress?

Viewing 7 replies - 26 through 32 (of 32 total)

  • horrorshow
    Member

    @horrorshow

    Hi,

    I am trying to integrate bbpress(0.8.3.1) with wordpress mu (1.3.3), and I am having some issues with cookies for login/logout.

    I’ve tried setting this: (“MD5hash” replaced with my MD5)

    $bb->usercookie = 'wordpressuser_MD5hash';
    $bb->passcookie = 'wordpresspass_MD5hash';

    However, that didn’t seem to synchronize login(meaning, if I am log into wp, go to bbpress and find myself already logged and vice versa)

    Watching the cookies during the login/out process on WP MU, I found that the cookie names that WP MU uses are: “wordpresspass” and “wordpressuser”

    So in config.php for bbpress, I used:

    $bb->usercookie = 'wordpressuser';
    $bb->passcookie = 'wordpresspass';

    This works somewhat, let me explain:

    This scenario works:

    Log into WPMU, refresh bbpress page, I find myself already logged into bbpress.

    Log out of WPMU, refresh bbpress page, I find myself logged out of bbpress.

    Log into BBpress, refresh WPMU, I find myself logged into WPMU

    This doesn’t work:

    Log into BBpress, refresh WPMU (I find myself logged into WPMU) AND THEN when I try to log out from WPMU, I can’t log out.

    I refresh BBpress page, and I am not logged out either.

    If I log out from BBpress at this point, then I am logged out of WPMU as well.

    I have a feeling it might be something with WPMU, but I thought I’d post here first since this is where I found all the information about the integration. Thanks for your help. I am appending my config.php relevant to the integration part.

    $bb->wp_table_prefix = 'wp_';
    $bb->wp_home = 'http://achillesblog.com';
    $bb->wp_siteurl = 'http://achillesblog.com';
    $bb->usercookie = 'wordpressuser';
    $bb->passcookie = 'wordpresspass';
    $bb->cookiepath = '/';

    thanks for your help.


    harryworld
    Member

    @harryworld

    horrowshow,

    I tried your settings, and it’s funny that if you login on either on side, you cannot log out on the other side.

    If I login WPMU first, I can only logout through WPMU.


    horrorshow
    Member

    @horrorshow

    Funny that my settings are screwy and there are better ways at accomplishing single sign on?

    Or funny: “yes, this is the closest that I am able to get to single sign-on, and I get the same results”?

    If it’s the first case, then please enlighten me.

    If it’s the second case, then this link might help you.

    http://bbpress.org/forums/topic/cookies-subtle-bug-single-sign-on-bbpress-and-wordpress


    harryworld
    Member

    @harryworld

    Sorry for misleading.

    I mean I got a similar case as you do, thus case 2

    and thanks for the link.

    I have done all the above directions but still can’t seem to get anything to work. It is not detecting the cookie and having be already logged in to bbpress after wordpress login. I have been working on this for some time.

    I have the exact same scenario that schmitt has at the beginning of this thread.

    Please help me out here, I have posted several thread but no one has helped me or taken a look at my config files.

    Here they are:

    bb-config.php

    <?php

    // ** MySQL settings ** //
    removed for security

    define('BBDB_CHARSET', ''); // If you are *upgrading*, and your old bb-config.php does
    define('BBDB_COLLATE', ''); // not have these two contstants in them, DO NOT define them
    // If you are installing for the first time, leave them here

    // Change BB_SECRET_KEY to a unique phrase. You won't have to remember it later,
    // so make it long and complicated. You can visit https://www.grc.com/passwords.htm
    // to get a phrase generated for you, or just make something up.
    // If you are integrating logins with WordPress, you will need to match the value
    // of the "SECRET_KEY" in the WordPress file wp-config.php
    define('BB_AUTH_KEY', '7k67k67k76'); // Change this to a unique phrase.
    define('BB_SECURE_AUTH_KEY', '67k67k76k67k76'); // Change this to a unique phrase.
    define('BB_LOGGED_IN_KEY', '67k76'); // Change this to a unique phrase.
    define('BB_SECRET_KEY', 'thisisone{crazy}sectret9084biugfhKey'); // Change this to a unique phrase.

    // If you are running multiple bbPress installations in a single database,
    // you will probably want to change this.
    $bb_table_prefix = 'bb_'; // Only letters, numbers and underscores please!

    // Change this to localize bbPress. A corresponding MO file for the
    // chosen language must be installed to bb-includes/languages.
    // For example, install de.mo to bb-includes/languages and set BB_LANG to 'de'
    // to enable German language support.
    define('BB_LANG', '');

    /* Stop editing */

    if ( !defined('BB_PATH') )
    define('BB_PATH', dirname(__FILE__) . '/' );
    require_once( BB_PATH . 'bb-settings.php' );

    // The rest is only useful if you are integrating bbPress with WordPress.
    // If you're not, just leave the rest as it is.

    $bb->wp_table_prefix = 'wp_econome'; // WordPress table prefix. Example: 'wp_';
    $bb->wp_home = 'http://www.fabuso.com/starteconome/blog'; // WordPress - Options->General: Blog address (URL) // Example: 'http://example.com'
    $bb->wp_siteurl = 'http://www.fabuso.com/starteconome/blog'; // WordPress - Options->General: WordPress address (URL) // Example: 'http://example.com'

    $bb->usercookie = 'wordpress_logged_in_my has here';
    $bb->passcookie = 'wordpress_logged_in_my has here';
    $bb->cookiedomain = 'fabuso.com';
    $bb->cookiepath = '/';

    ?>

    wp-config.php

    <?php
    // ** MySQL settings ** //
    removed for security

    // Change each KEY to a different unique phrase. You won't have to remember the phrases later,
    // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/
    // to get keys generated for you, or just make something up. Each key should have a different phrase.
    define('AUTH_KEY', '7k67k67k76'); // Change this to a unique phrase.
    define('SECURE_AUTH_KEY', '67k67k76k67k76'); // Change this to a unique phrase.
    define('LOGGED_IN_KEY', '67k76'); // Change this to a unique phrase.
    define('SECRET_KEY', 'thisisone{crazy}sectret9084biugfhKey');
    define('COOKIE_DOMAIN', 'fabuso.com');
    define('COOKIEPATH', '/');

    $wp->cookiepath = '/';
    $wp->sitecookiepath = '/';
    define('SITECOOKIEPATH', '/');

    // You can have multiple installations in one database if you give each a unique prefix
    $table_prefix = 'wp_econome_'; // Only numbers, letters, and underscores please!

    // Change this to localize WordPress. A corresponding MO file for the
    // chosen language must be installed to wp-content/languages.
    // For example, install de.mo to wp-content/languages and set WPLANG to 'de'
    // to enable German language support.
    define ('WPLANG', '');

    /* That's all, stop editing! Happy blogging. */

    if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');
    require_once(ABSPATH . 'wp-settings.php');
    ?>

    In your bb-config:

    $bb->wp_table_prefix = 'wp_econome'; // WordPress table prefix. Example: 'wp_';

    In your wp-config:

    $table_prefix = 'wp_econome_'; // Only numbers, letters, and underscores please!

    Looks like you’re missing an underscore in bb-config.

    Also try changing this on your bbconfig: $bb->sitecookiepath = '/starteconome/blog/';


    pimarts
    Participant

    @pimarts

    Pretty excited to see if you can find another topic to paste that link into.

Viewing 7 replies - 26 through 32 (of 32 total)

You must be logged in to reply to this topic.