Contribute  :  Support  :  Downloads  :  Forum  :  Links  :  Polls  :  Calendar  :  Directory  :  Advanced Search  
Geeklog The Ultimate Weblog System
Welcome to Geeklog
Friday, May 16 2008 @ 01:45 AM EDT
   

Geeklog 2 Update

Geeklog 2Geeklog 2 this, Geeklog 2 that. By now many of you are wondering what the hell *is* this vaporware. Well, I'm happy to announce that Geeklog 2 now has a pulse. This evening I managed to get a small set of the new authentication and authorization code working along with a new custom PHP4 session handler that will simplify how Geeklog 2 handles sessions and it will allow us to serialize PHP objects to the session. For many of you this update is enough but if you are a real geek and want the gory details along with other current efforts click 'read more'

Here is what I posted to the geeklog-devel mailing list (FYI, you can get development updates on GL2 by joining the geeklog-devtalk list.

Ok, granted it isn't rocket science but it is, in fact, a start. Please bare with me and read this it it's entirety.

Go here:

http://project.geeklog.net/~tony/

There you will see a very simple login box with account information below it on how to get in. Once you log in you are presented with a link that will take you to a page that will dump out a bunch of session data.

Here is what is happening:

1) When you hit submit, a request for authentication is built in the form of an XML string. This XML string contains:
- Application ID
- Username
- Password
- Command Name (in this case authenticate)

2) Server receives the request and sends it to the command factory which recognizes the XML request as an authentication request. It then instantiates (on the fly) an instance of the authenticate command and tells it to execute.

3) Authenticate command then passes the application ID to the provider factory to determine which data provider to authenticate against. In this case it builds an instance of the SQLProvider class and executes the authenticate method.

4) SQLProvider authenticates user, gets any group and permissions tied to the user and returns the results back to the authenticate command.

5) Authenticate command then builds an XML response and sends it back to calling application.

6) The client receives the response, parses it into a User object and saves it to the session (which is stored in the database). It then shows you the link to a new page.

7) new page pulls the user object from the session with a single DB call and outputs a few attributes on the user.

To be clear this establishes a few things:

a) we now have an A&A service which can service many applications to implement a single credential set. This makes the prospect of tying other applications in easy encouraging 3rd party apps to work with GL2

b) service can run on a separate box from GL or (as in this case) on same box.

c) user data is persisted to a database using PHP4 sessions effectively rendering all the code that use to be in lib-sessions.php useless (saving, restoring and garbage collection is done for us by PHP)

d) succesfully pulled a PHP OO user object from the session with a single database hit. If you recall in GL 1.3.x you have to sometime hit 2 or 3 tables often with independent queries against user, user_index, user_prefs, etc in order to re-establish session. Now you do it with one DB call that you don't even make (PHP4 session handler pulls it for us when you call session_start).

There is still a lot of work to do. I'd like to convert one of the service methods to use SOAP just to see how much easier that will simply the code (with SOAP I don't have to build and parse XML which also removes the requirement having xml support compiled into PHP). If that tests out Ok and if timing benchmarks both on the same server and on separate servers is acceptable I will convert it over.

However, in the meantime, we need to start concentrating on localization. Handling language effectively as well as time/currency stuff will be key and, frankly, we can't go anywhere else without getting that done. Marc, if I get you a template for a detailed requirements document do you think you could get it started for us? By them time you get a draft of that I should have this code stable enough to start divying up work immediately.

--Tony

Story Options

Geeklog 2 Update | 10 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
requirements
Authored by: jcz on Friday, January 17 2003 @ 11:50 PM EST
Looks terrific. Seems like there is a lot of added versatility there. XML parsing, SOAP... what will the minimum requirements be of GL2 as it stands right now?
requirements
Authored by: Tony on Monday, January 20 2003 @ 10:19 PM EST
We are working on requirements in sub-sections. For this A&A part you can get requirements here. You can expect to be able to see drafts of the localization and module API here soon.

---
The reason people blame things on previous generations is that there's only one other choice.

Geekog 2 Update
Authored by: squatty on Saturday, January 18 2003 @ 11:02 AM EST
Just a thought...might be overkill but, is there any encryption of the username and or password in step 1? Or do you pass everything in clear text?

---
Danny @ squatty.com
Geekog 2 Update
Authored by: vinny on Saturday, January 18 2003 @ 12:39 PM EST
Please confirm if I'm wrong, but it should be pretty easy to wrap all this up in SSL for security... Perhaps an SSH tunnel for communications between the client and server?

I think we should definitely encourage encryption between the A&A client and server at the very least. This will become very important once people start putting the A&A client/server on different machines.

$.02
-Vinny
Geekog 2 Update
Authored by: dbsmall on Monday, January 20 2003 @ 12:26 PM EST
I don't know how simple it would be to wrap it in SSL, since PHP (when I last looked) and SSL didn't work together well. That said, it would be possible to implement some similar encryption at the app level (I'm sure there are public-key encryption classes availalbe) rather than the socket level.
Geekog 2 Update
Authored by: Tony on Monday, January 20 2003 @ 10:15 PM EST
If you are using the authentication and authorization service on a remote box you will have to do this via an ssl-enabled connection. Not doing so would be a bad security decision. Usernames will not be encrypted, passwords will be md5'd.

---
The reason people blame things on previous generations is that there's only one other choice.
Geeklog 2 Update
Authored by: ScurvyDawg on Saturday, January 18 2003 @ 03:56 PM EST
You could use Stunnel as we do at work for SSL encryption.

www.stunnel.org
Geeklog 2 Update
Authored by: Anonymous on Monday, January 20 2003 @ 04:57 AM EST
I'm currently preparing for my magazine and are playing around with the script, I'm glad I found geeklog before using any of the nukes or whatever... I have a list of feature suggestions and ideas. Are you interested, where should I send this to?
Geeklog 2 Update
Authored by: Dirk on Monday, January 20 2003 @ 11:15 AM EST

There's already a long list of feature requests on our Feature tracker ...

bye, Dirk

Geeklog 2 Update
Authored by: Anonymous on Tuesday, January 21 2003 @ 02:31 AM EST
Thanks for the answer, I need to check the sourceforge page more... =]