[AuthMe] Website integration

Discussion in 'Bukkit Help' started by sikkens1997, Feb 8, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    sikkens1997

    Hello,

    I am trying to integrate AuthMe Reloaded onto my website. I am using PHPBB forum software (I can change to whatever software is needed).
    I have searched for a very long time, but I can't find it. Here is the link from the developers: http://dev.bukkit.org/bukkit-plugins/authme-reloaded/pages/web-site-integration/

    But all they give is a code. I don't know where to put this code and what to do with this code. The developers of the plugin seem to be very inactive, so that's why I'm posting this here.

    If any of you know how to integrate an existing MySQL database to my site, please tell me how.

    Thank you.
     
  2. Offline

    sikkens1997

    Bump please help.
     
  3. Offline

    Adriani6

    You would need to add AuthMe to MySQL to log all usernames and passwords in there, then from your PHPBB forums software, you would have to change the Database of which the it listens for logins to match the usernames and passwords from.
     
  4. Offline

    sikkens1997

    Thanks for the reaction.

    I have added all the AuthMe to MYSQL, but I can't figure out how to change the login Database to the MYSQL database.

    Can someone please tell me how to change the login database to the mySQL database?
     
  5. Offline

    GerCraft

    sikkens1997
    why do you use authme ?
    are you running a cracked server ?
     
  6. Offline

    Adriani6

  7. Offline

    sikkens1997

    That also changes the forum database, right? I only want to change the login database. Or do I need to re-install the forum-database on the login-database?

    If any1 knows please tell me.

    Bump
     
  8. Offline

    sikkens1997

    Bump

    bump

    bump

    <Merged triple post - Bumping is allowed only every 24 hours - Necrodoom>
     
  9. Offline

    sikkens1997

    Please help.
     
  10. Offline

    sikkens1997

  11. Offline

    Pangamma

    This is a PHP function, for sure. It would require AuthMe to have its values stored to a MySQL database so you can tap into it with web based PHP. Do you know PHP? What is your level of understanding in code, as this won't be a simple cut and paste operation.

    // @return true if password and nickname match
    function check_password_db($nickname,$password) {
    // Here u have to include your DB connection and select!
    mysql_connect(... bunch of crap here );

    $a=mysql_query("SELECT password FROM authme where username = '$nickname'");
    if(mysql_num_rows($a) == 1 ) {
    $password_info=mysql_fetch_array($a);
    $sha_info = explode("$",$password_info[0]);
    } else return false;
    if( $sha_info[1] === "SHA" ) {
    $salt = $sha_info[2];
    $sha256_password = hash('sha256', $password);
    $sha256_password .= $sha_info[2];;
    if( strcasecmp(trim($sha_info[3]),hash('sha256', $sha256_password) ) == 0 ) return true;
    else return false;
    }

    }
     
  12. Offline

    sikkens1997

    I don't know a lot about PHP. Only some basic codes. Is it possible for you to provide me with a step-by-step plan? Would be greatly appreciated if you could.
    I have the MySQL database, I just don't know how to connect my forum software to use it as a login database.
     
  13. Offline

    sikkens1997

    Please help.
     
  14. Offline

    Pangamma

    /**
    @param string $nickname the nickname of the user
    @param string $password the password of the user
    @return true if password and nickname match */
    function check_password_db($nickname, $password) {
    // Here u have to include your DB connection and select!
    $a = mysql_connect('localhost', 'mysql_user', 'mysql_password') or die ('could not connect to mysql');
    $a=mysql_query("SELECT password FROM authme where username = '$nickname'");
    if(mysql_num_rows($a) == 1 ) {

    $password_info=mysql_fetch_array($a);

    $sha_info = explode("$",$password_info[0]);
    } else return false;
    if( $sha_info[1] === "SHA" ) {
    $salt = $sha_info[2];
    $sha256_password = hash('sha256', $password);
    $sha256_password .= $sha_info[2];;
    if( strcasecmp(trim($sha_info[3]),hash('sha256', $sha256_password) ) == 0 )
    return true;
    else return false;
    }
    }
    1) Edit $a = mysql_connect('localhost', 'mysql_user', 'mysql_password') or ... So that it matches the info used in your authme configuration file. (Or edit your authme so it matches the info for your database.)
    2) Edit the code so that PHPBB will use the 'check_password_db()' function to determine whether a user has the correct username and password or not. You should replace whatever PHPBB is currently using for authentication with this new check_password_db method.
    3) Don't forget to sanitize your data (username + password) to prevent SQL injection attacks. Confused? Please do your own research on this.


    The above three steps should help you figure it out. That's about all the information I can give you as I can't walk you through the entire process. Good luck though!
     
Thread Status:
Not open for further replies.

Share This Page