Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 03-12-2008, 11:51 PM
cowboyd cowboyd is offline
 
Join Date: Mar 2008
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default External Authentication: The SIMPLEST thing that could possibly work?

Hi there,

I'm migrating our current forum from drupal to vbulletin. Our main user database and profile data is in a java application running in the same domain. I've successfully integrated (mostly) our users but I'm running up against some problems when it comes to authenticating the user.

The way it works is this:

All the users in the java application have a forumId field which contains the vbulletin userid of that user's corresponding forum account. There is a REST api in the java application for converting a sessionids into forumId.

So, I wrote a little php hook in drupal to read the sessionid from a cookie (set by the main java application), then make the REST call to the java app to convert the sessionid into a userid, and then, load the user into the php request based on that id (if no id is found, then just load the anonymous user)

Now that I have the userid, I know they must have already been authenticated by the main application to have gotten a valid session id, so I don't need to do any other form of authentication. I know which user, and I know that they're authenticated, so I just want to have everything else just use that user.

I don't want vbulletin to do login at all. I don't want it to collect the username/password at all. I never want it to show a login form of any kind. I just want it to take the id it gets back from the java application and handle the request as though that user was logged in the entire time.

In cases where a login is required, I want it to redirect to the java application.

Does this clarify things?
Reply With Quote
  #2  
Old 03-13-2008, 03:50 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The basics on how to integrate a vBulletin session can be found in the Articles section. A few articles should have information regarding this topic.
Reply With Quote
  #3  
Old 03-13-2008, 06:32 PM
cowboyd cowboyd is offline
 
Join Date: Mar 2008
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This was about the closest thing I could find, but it doesn't really work because

1) We don't control the apache deployment, and
2) it requires you to have access to the vbulletin username and password.
Reply With Quote
  #4  
Old 03-13-2008, 07:36 PM
Reeve of shinra's Avatar
Reeve of shinra Reeve of shinra is offline
 
Join Date: Oct 2001
Location: NYC
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There are two projects out there focusing on integrating drupal with vb... you may want to check into them as it sounds like it may be the best long term solution for you.
Reply With Quote
  #5  
Old 03-13-2008, 07:36 PM
cowboyd cowboyd is offline
 
Join Date: Mar 2008
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok,

I was able to get it to work somewhat, by modifying init.php

PHP Code:


$uid 
0;
$session_id $_COOKIE['gameonleagues-signon'];
if (
$session_id) {
    
$ch curl_init();
        
//call out to java application.
    
$LEAGUE_LOOKUP "http://localhost:8080/account/session2forumid";
    
curl_setopt($chCURLOPT_URL,"$LEAGUE_LOOKUP/$session_id");
    
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
    
curl_setopt($chCURLOPT_VERIFYPEERfalse);
    
curl_setopt($chCURLOPT_VERIFYHOSTfalse);
    
curl_exec($ch);
    if (!
curl_errno($ch)) {
        
$uid curl_multi_getcontent($ch);
    } else {
        
//curl error, java site is down.
    
}
}

$vbulletin->session->userinfo =& fetch_userinfo($uid); 
that seems to load the user in their every time. Now, I just need to disable the login box, and the logout link, or, have the login form submit to my java application.

--------------- Added [DATE]1205441158[/DATE] at [TIME]1205441158[/TIME] ---------------

Quote:
Originally Posted by Reeve of shinra View Post
There are two projects out there focusing on integrating drupal with vb... you may want to check into them as it sounds like it may be the best long term solution for you.
Actually, I migrating away from drupal altogether. We were using them as our forum software. The drupal api is super slick, and I was able to integrate their site with single signon without any changes to the drupal core. However, the drupal forums are pretty lame on a good day.

What I want is for vbulletin to fulfill the role that drupal did. namely, the forum software that complements our main site (in java).
Reply With Quote
  #6  
Old 03-14-2008, 03:20 AM
lhama lhama is offline
 
Join Date: Mar 2008
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I am reaallyy new to this, but from what I read here I understand that you guys are talking about the thing I wanna do. So I want to know little more about your way of doing it.
I also have a drupal website and a not so good forum with it. I have purchased vB and want to add to my website. Now, my users register their baby's birthday (and more) and I display them their baby's age and proper information on login, so I couldn't possibly use vB authentication for my main website, so instead i wanna use main registration for vB and don't want vB to have any login window etc. Sounds like you have made it little further that I am, so could you please, help with it? Little guidance, step by step? I would really apreciate.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:38 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07375 seconds
  • Memory Usage 2,214KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete