SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2002
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cross-program authentication

    Anyone ever try to build an application from an external source into their existing CMS? Or gathering, say, the best 5 php apps you use and build a common platform for authentication? For example a forum, news system, project administration, photo album, etc?

    Any good solutions there? Can anyone think of a good way to solve this in theory maybe, since most apps use different methods of authentication?

  2. #2
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It depends on how the apps are written. If the app is well written, you should be able to just replace its user authentication code with your own, using the same 'interface' as the code you're replacing, but behaving in a different way.

    If you've already written your own user authentication code, and you want to convert other apps to use the same user authentication system, then you may be able to create an 'adaptor'. That is, you replace the code in their user authentication system with code accepts the same interface as their user authentication system but intercepts its input and translates it, submitting it to your existing user authentication system.

    So, let's say you're modifying a forum application to replace its user authentication system so that it uses your own system. For this to work, all the user authentication code must be in the same place (in a particular library file, or a particular class or set of classes). Rewrite the functions in this code so that the code actually calls your own authentication system instead.

    In a poorly written application, you won't be able to do this. What I mean is, if the application has various bits of code for user authentication all over the place, rather than just in one library file, class or set of classes, then you'd have to find every part of code in the entire application which has anything to do with user authentication. In a really well written application, you should be able to just remove the file that handles users, and plug in your own version of it instead.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2002
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The first problem that comes to mind is software updates. If I change authentication methods in other programs to fit my own authentication scheme, then I will have to do the same changes over again every time this software updates its authentication methods.

    I guess thats just the price you have to pay?

    Authentication is one thing, but maintaining a database of users usually goes hand-in-hand with this task.

    Take for instance a forum software that keeps its own user table with detailed information on each user. If I am to use my own user table for authentication, I would have to change the functionality for user administration in the forum software too.

    Any thoughts on an easier way to handle this? Anyone who has solved this before might want to speak up ...

  4. #4
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by torkil
    The first problem that comes to mind is software updates. If I change authentication methods in other programs to fit my own authentication scheme, then I will have to do the same changes over again every time this software updates its authentication methods.

    I guess thats just the price you have to pay?
    Again, this depends on how well the software's written. If it's done well, then when you upgrade the software you'll be able to just plug in the same file again and it will work, or maybe you'll just need to modify it a small amount. If it's not, then you'll have to search through the entire application and re-do every modification you did last time.

    Quote Originally Posted by torkil
    Take for instance a forum software that keeps its own user table with detailed information on each user. If I am to use my own user table for authentication, I would have to change the functionality for user administration in the forum software too.
    Again, not if the software's well-written. In the best possible case, all code for reading to and writing from the user tables will be in the one place.

    As you can tell, it's times like this when you appreciate good application design and modularity.

    In something like vbulletin, for instance, this would be extremely difficult as the code for writing to and reading from pretty much any table is all over the place. There is no abstracted interface for a 'user'.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff

  5. #5
    SitePoint Enthusiast
    Join Date
    Nov 2002
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So, without mentioning OO programming by words, you are recommending it?

    Any good suggestions for php forum software that is well suited for being built into a "hostile" CMS then?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •