+ Reply to Thread
Results 1 to 7 of 7

Thread: Intercepting Login Process

  1. #1
    Join Date
    Jun 2009
    Posts
    69

    Default Intercepting Login Process

    I'm trying port a highly customized MediaWiki install to MindTouch. One of the custom extensions hooks into the logon process, checks the users against a special table with names and IPs and if the user is listed and the IP they're requesting from isn't, will abort the logon.

    I would like to avoid writing an entire Authentication Provider just for this simple process. Is there a better way? Can I even pass the requester's IP to the provider?

  2. #2
    Join Date
    Feb 2007
    Posts
    1,871

    Default

    Since Lyons (9.02), we have hooks on the front-end; you could do a conceptually similar action - I'd take a peek at: http://developer.mindtouch.com/en/MindTouch/PHP/Plugins

  3. #3
    Join Date
    Jun 2009
    Posts
    69

    Default

    Excellent, thank you. I did see http://developer.mindtouch.com/Deki/Specs/Lyons/Hooks but it only listed Logout as completed.

  4. #4
    Join Date
    Feb 2008
    Location
    London upon Thames
    Posts
    2,792

    Default

    That doesn't mean the programming is complete, it means the hook runs after a logout is complete
    If my post helped you, please click the icon below this post to my reputation. Thanks!

  5. #5
    Join Date
    Jun 2009
    Posts
    69

    Default

    Actually I was referring to where it said "Locations in blue have been implemented. This is an idea list." and login wasn't on the list at all.

  6. #6
    Join Date
    Feb 2007
    Posts
    1,871

    Default

    Probably time for Guerric to update that documentation The complete list of hooks (I know they are poorly doc-ed right now) is available on that first link (at the bottom).

  7. #7
    Join Date
    Oct 2007
    Location
    San Diego, CA
    Posts
    1,237

    Default

    You can see a list of the hooks in /deki/plugins/deki_plugin.php. I've also started a new section on the developer wiki to facilitate documenting the plugins API. http://developer.mindtouch.com/en/MindTouch/PHP

    For user login, there are 2 hooks:
    const MAIN_LOGIN = 'Main:Login';
    const MAIN_LOGIN_COMPLETE = 'Main:LoginComplete';

    MAIN_LOGIN is invoked when creds are passed in. MAIN_LOGIN_COMPLETE fires after the user has already been authenticated in the system. You'll want to intercept the MAIN_LOGIN request.

    Bare in mind that these tactics only restrict the user from logging in through the UI.

+ Reply to Thread

Posting Permissions

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