magento admin login through curl

I want to post the magento admin username and password through curl once the login is successful should redirect to the magento admin dashboard.
How can i do it?
Basically magento login requires this information:

require_once ("magentoappMage.php" );

// Initialize Magento

// You have two options here,
// "frontend" for frontend session or "adminhtml" for admin session
Mage::getSingleton("core/session", array("name" => "adminhtml"));
$session = Mage::getSingleton("admin/session");

How can I proceed?

One thought on “magento admin login through curl”

  1. <?php
    require_once 'app/Mage.php';
    $app = Mage::app('default');
    Mage::getSingleton('core/session', array('name' => 'adminhtml'));
    // supply username
    $user = Mage::getModel('admin/user')->loadByUsername('adminusername');
    if (Mage::getSingleton('adminhtml/url')->useSecretKey()) {
    $session = Mage::getSingleton('admin/session');
    if ($session->isLoggedIn()) {
      echo("logged in");

Leave a Reply

Your email address will not be published. Required fields are marked *