Community discussions

MikroTik App
 
sidsukana
just joined
Topic Author
Posts: 3
Joined: Sun Nov 18, 2012 9:26 am

API auth

Sun Nov 18, 2012 9:47 am

About 2 days I can not log in using MikrotikAPI
Writed in C++/Qt, used the example of a wiki but always comes "!trap cannot login"

For example http://wiki.mikrotik.com/wiki/Manual:API#Initial_login - what password used here to get such a hash?

That's how I make a hash:
std::string md5ChallengeBinary = MD5ToBinary(challenge.toStdString());
    std::string stdpass = m_password.toStdString();

    QCryptographicHash hash(QCryptographicHash::Md5);
    hash.addData("\0");
    hash.addData(stdpass.c_str(), stdpass.length());
    hash.addData(md5ChallengeBinary.c_str(), md5ChallengeBinary.length());

    QString md5PasswordToSend = hash.result().toHex();

WriteWord("/login");
    WriteWord("=name=" + m_login);
    WriteWord("=response=00" + md5PasswordToSend);
    WriteWord("\0");
And always get "!trap"

Who is online

Users browsing this forum: anav, broderick, Kuitz, xrlls and 87 guests