Results 1 to 2 of 2

Thread: Integrating IPS board with Magento for universal login

  1. #1
    Junior Member Princessly's Avatar
    Join Date
    Oct 2012
    Location
    Princessly.com
    Posts
    29

    Integrating IPS board with Magento for universal login

    It would be a tremendous user experience bless to have a universal login across various apps of my website. For now, I have a storefront of Magento and a community of IPS board. And I'm trying to integrate them into one universal login for my users.

    IPS board offers a variety of login methods and one of them is External Database that enables me to integrate it with an external database for user details.

    Fantastic! So I can link IPS with Magento's database for unified user credentials.

    However, thus far I can only find the email field that is customer_entity.email.

    My questions are:

    1. What is the password hash field (table.field)?
    2. How does Magento generate password hash? MD5? SHA1? What is the salt (I guess it's different by installation)?

    As you can see from the attached images, I need the details of where and how Magento stores password to enable IPS to use Magento's database for user details.

    Click image for larger version. 

Name:	External Database.png 
Views:	427 
Size:	55.2 KB 
ID:	11 Click image for larger version. 

Name:	installed login handlers.png 
Views:	436 
Size:	18.0 KB 
ID:	10
    Last edited by Princessly; 10-06-2012 at 05:04 AM.
    Live in the fairy tale, Princessly, the valiant store.

  2. #2
    Administrator Kavoir's Avatar
    Join Date
    Dec 2009
    Posts
    183
    This is how you should authenticate the user in the auth.php of login module against Magento database as an External Database for IPB:

    PHP Code:
    //-----------------------------------------
    // Check
    //-----------------------------------------

    require_once(IPS_KERNEL_PATH.'../../app/Mage.php'); // load Magento Mage.php with IPB installed at a sub-directory of the domain
    Mage::app();
    $customer Mage::getModel('customer/customer')->setWebsiteId(Mage::app()->getStore()->getWebsiteId());
    $customer->loadByEmail($email_address);
    if (!
    $customer->getId()) {
        
    $this->return_code 'NO_USER';
        return 
    false;
    }

    //-----------------------------------------
    // Check password
    //-----------------------------------------

    $password            html_entity_decode($passwordENT_QUOTES);
    $html_entities        = array( "!""$""\" );
    $replacement_char    = array( "!", "$", "\\" );
    $password             = str_replace( $html_entities$replacement_char$password );

    try {
      if (
    $customer->authenticate($email_address$password)) {
      }
    } catch (Mage_Core_Exception 
    $e ) {
        
    $this->return_code = 'WRONG_AUTH';
        return false;

    The road goes ever on and on.

Posting Permissions

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