|
External login/authentication system
|
|
07-31-2008, 10:27 AM
(This post was last modified: 07-31-2008 01:18 PM by atamur.)
Post: #1
|
|||
|
|||
|
External login/authentication system
Hi
I've found a couple of similar topics but none contained really usefull information =( I'm going to use some external SSO (single sign on) system to authenticate users for MyBB. The workflow would be: 1. user opens mybb 2. user is not logged in into mybb 3. user is redirected to sso.mydomain 4. user enters valid credentials 5. user is redirected to mybb?ticket=####&userid=### 6. code checks the ticket/userid against a shared DB and finds it valid 7. user is logged into mybb using mybb user info (if it's a first time this user accesses mybb appropriate account is created) 8. user is redirected to mybb So my question is how do I best do the following: - #2: I'd like to find that out as soon as possible, like in the top of global.php to redirect user before any headers are sent - #7/1: how to programatically log a user in - #7/2: how to programatically create and activate a user Thanks a lot for your help! Ilya. Ok, I did it - was simplier that I could imagine ... Could some take a look if I missed smth huge (all changes in global.php, insert after line 43): Code: /* ------------------- sso integration ----------------------- */ |
|||
|
07-31-2008, 11:45 PM
Post: #2
|
|||
|
|||
|
RE: External login/authentication system
Why not just look at the cookies?
Who is Yumi? It's still the KFC crazed person who can't spell names properly with annoying AlTeRnAtInG CaPiTaLs in the NaMe
|
|||
|
08-01-2008, 06:15 AM
Post: #3
|
|||
|
|||
|
RE: External login/authentication system
mmmm - what do you mean?
|
|||
|
08-02-2008, 01:11 AM
Post: #4
|
|||
|
|||
|
RE: External login/authentication system
When you log into MyBB, a cookie is set on the client's machine so that MyBB knows someone is logged in. For your website, why not just simply check what cookies are being sent to determine whether a user is logged in? You don't even need to bother with writing registration/login code (it's all done for you).
Who is Yumi? It's still the KFC crazed person who can't spell names properly with annoying AlTeRnAtInG CaPiTaLs in the NaMe
|
|||
|
08-02-2008, 06:22 AM
Post: #5
|
|||
|
|||
RE: External login/authentication system
(08-02-2008 01:11 AM)ZiNgA BuRgA Wrote: When you log into MyBB, ...Erm ... have you ever read my first post? =) Thank you for talking to me though - you are the only one who takes interest =) The whole idea is I DO NOT want anybody to log in to MyBB =) So my problem is - I have some external method of authentication/authorization which I already use for 4 heterogeneous systems and now I'd like to use it for MyBB because I don't want my users to register themselves and learn new login/passwords/login screens ... I have this system which tells me: "Ok, I know this guy and his login/email ... pls let him in to the forums ..." and I need a way to tell MyBB that this user is ok and can use forums. Just for reference here are the older topics which were never resolved: http://community.mybboard.net/thread-30698.html http://community.mybboard.net/thread-17881.html As for me, the solution described above works perfectly and I was just wondering maybe I forgot smth important ... =) |
|||
|
08-02-2008, 08:50 AM
(This post was last modified: 08-02-2008 08:52 AM by Yumi.)
Post: #6
|
|||
|
|||
|
RE: External login/authentication system
If you have an authentication system already in place and want MyBB to authenticate against that, probably the easiest method is to forge a cookie to trick MyBB into thinking a particular use is logged in, via cookies. (set $_COOKIES['mybbuser'] before the session is loaded, example:
PHP Code: // assume $uid contains the userid of the userWho is Yumi? It's still the KFC crazed person who can't spell names properly with annoying AlTeRnAtInG CaPiTaLs in the NaMe
|
|||
|
« Next Oldest | Next Newest »
|
Search
Member List
Calendar
Help




