Setting up auth server

Post here if you need help setting up your server, etc.
Moofie
Core Dumper
Posts: 125
Joined: Fri Jan 27, 2012 1:36 am
Location: Ohio
Contact:

Setting up auth server

Post by Moofie »

I think this is the right place to post this... I'm trying to setup an auth server using the script provided from the wiki article in this: http://bazaar.launchpad.net/~armagetron ... ork/files/ (so basically the script that takes data from the database). Now, I almost got it, but I try to login and I get this error:

Code: Select all

 Login failed, reason: Answer "PASSWORD_OK ..." expected from server, but got <br /> <b>Warning</b>:  mysql_num_rows(): supplied argument is not a valid MySQL result resource in <b>/www/zzl.org/s/h/e/shenanaboosh/htdocs/armaauth/0.1/index.php</b> on line <b>95</b><br /> <br /> <b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /www/zzl.org/s/h/e/shenanaboosh/htdocs/armaauth/0.1/index.php:95) in <b>/www/zzl.org/s/h/e/shenanaboosh/htdocs/armaauth/0.1/functions.php</b> on line <b>72</b><br /> <br /> <b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /www/zzl.org/s/h/e/shenanaboosh/htdocs/armaauth/0.1/index.php:95) in <b>/www/zzl.org/s/h/e/shenanaboosh/htdocs/armaauth/0.1/functions.php</b> on line <b>73</b><br /> USER_NOT_FOUND instead.
I don't know what it means, I thought about editing the line 95 like it says (mysql_num_rows) and other parts, but I didn't want to mess it up, cause I know I will :P

Edit: I also renamed the armaauth.php to index.php as it didn't work as armaauth, but I know that index is used in the other one. When I had it named armaauth.php it said something like it was an unsupported address.
User avatar
Z-Man
God & Project Admin
Posts: 11624
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Setting up auth server

Post by Z-Man »

What does your config.php look like? (Minus passwords) The script is poor on internal error handling and the error you got seems to just indicate something went wrong earlier and wasn't caught.
Moofie
Core Dumper
Posts: 125
Joined: Fri Jan 27, 2012 1:36 am
Location: Ohio
Contact:

Re: Setting up auth server

Post by Moofie »

Code: Select all

<?php

/* http-auth-server -- Implementation of the Authentication server reference implementation 0.1
 * This config file is free of use.
 */

$dbs = array(
    // Replace forums with the name of your AAGID authority.
    // This is what the users will type when loging in, it is usually your DNS.
    // The main script (armaauth.php) should be accessible by using this address: <http://authority/armaauth/0.1/>.
    'shenanaboosh.zzl.org'
    => array(

        // MySQL server location
        'host' => 'shenanaboosh.zzl.org',

        // MySQL DB name
        'name' => 'shenanaboosh_zzl_website',

        // MySQL user
        'user' => '708701_admin',

        // MySQL password
        'passwd' => '*****',

        // MySQL table name
        'table' => 'smf_members',

        // Username column
        'user_row' => 'member_name',

        // Methods to allow. Current valid methods are md5, bmd5, and webform. You can use sha1 as well, but it isn't used.
        'validMethods' => array( 'bmd5', 'md5' ),

        'params' => array(
            // Prefix/Suffix to append/prepend to the password before hashing
            // (You need to change the hashes in your DB if you change these!)
            'prefix' => '',
            'suffix' => ''
        ),

        // Method-specific settings. They can override stuff defined earlier in this file.
        'methods' => array(
            'bmd5' => array(
                // MySQL Column containing the bmd5 hash
                'row' => 'bmd5_hash'
            ),
            'md5' => array(
                // MySQL Column containing the md5 hash
                'row' => 'md5_hash'
            ),
            'sha1' => array(
                // MySQL Column containing the sha1 hash
                'row' => 'sha1_hash'
            ),

            // If you're not serving webform authentication, you can forget about this.
            'webform' => array(
                // To use the webform method, you have to use a separate table.
                'table' => 'AAGID-webform',

                // Time in seconds until a server authentication key expires so that a login process won't be valid anymore.
                'siteKeyTimeout' => 5 * 60,

                // Column containing the authority contacted, so you can use the same table for more authorities.
                'authority_row' => 'authority',

                // Column containing the contacting site's login process key
                // (unique for each authentication process)
                'user_row' => 'site_key',

                // Column containing the md5 hash of the site's key
                'site_key_hash_row' => 'site_key_hash',

                // Column containing the time the site's key was created
                'site_key_time_row' => 'site_key_time',

                // Column containing way to contact the site itself
                'site_row' => 'site',

                // Column containing the username of the user that's
                // currently being authenticated
                'username_row' => 'username',

                // Column containing the hash of the site's and user's keys
                'row' => 'hash',
            ),

        ),

    ),
    // Repeat this whole section if you want to setup this for more authorities.
);

// DO NOT CHANGE THIS UNLESS YOU KNOW WHAT YOU'RE DOING
// This will change the address trough shorthand authorities will be contacted.
// Changing this setting is only useful if you're exporting AAGID to something else than armagetronad
// Shorthand authorities(those with which you don't have to type the whole name) are contacted
// by appending $rootDomain preceeded with a dot to the shorthand authority's name. Example:
// g.authentication.armagetronad.net // Here, g is the name of the shorthand authority, so
// the users can use user@g to authenticate with g.authentication.armagetronad.net
$rootDomain = 'authentication.armagetronad.net';

?>
In the database there is a 'passwd' column with md5 passwords I believe, and there is also a 'salt' column, but the script didn't request those.

Edit, It did ask. But I don't know the difference between md5 bd5 sha1 all those so... not sure.
User avatar
Jip
Round Winner
Posts: 397
Joined: Sat Sep 26, 2009 5:32 pm

Re: Setting up auth server

Post by Jip »

SMF (I guess it's Simple Machines Forum?) doesn't save MD5 hashes. They get salted and they use sha1 I think.
Moofie
Core Dumper
Posts: 125
Joined: Fri Jan 27, 2012 1:36 am
Location: Ohio
Contact:

Re: Setting up auth server

Post by Moofie »

Here is a password of a test account I made, just to show what it looks like:

Code: Select all

4c337bbcc9b14a1a260eb05a75357ac64df47123
User avatar
Z-Man
God & Project Admin
Posts: 11624
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Setting up auth server

Post by Z-Man »

That looks like sha1 all right. You'll need to modify the forum software to also store it as md5.
And you need to set the name of that row in config.php, in the

Code: Select all

'row' => 'md5_hash'
line.
Also, you should disable bmd5 by removing it from the methods array. It's just for very old clients.

Test URI for future reference: http://shenanaboosh.zzl.org/armaauth/0. ... &user=sven
User avatar
AI-team
Shutout Match Winner
Posts: 1020
Joined: Tue Jun 23, 2009 6:17 pm
Location: Germany/Munich
Contact:

Re: Setting up auth server

Post by AI-team »

Z-Man wrote:...You'll need to modify the forum software to also store it as md5...
I thought armathentication also supports sha1?
  
 
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
 
 
Moofie
Core Dumper
Posts: 125
Joined: Fri Jan 27, 2012 1:36 am
Location: Ohio
Contact:

Re: Setting up auth server

Post by Moofie »

Code: Select all

// Methods to allow. Current valid methods are md5, bmd5, and webform. You can use sha1 as well, but it isn't used.
        'validMethods' => array( 'bmd5', 'md5' ),
That's in config.php. Couldn't you just write so that sha1 is valid in the valid array?
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Re: Setting up auth server

Post by Tank Program »

The client needs to support sha1 as well. Having sha1 there was more of a future proofing type thing.
Image
nelg

Re: Setting up auth server

Post by nelg »

Whats up with this php script? its unlike any tron script ive ever made.

First of all:

Code: Select all

        // MySQL server location
        'host' => 'shenanaboosh.zzl.org',

        // MySQL DB name
        'name' => 'shenanaboosh_zzl_website',
shenanaboosh...Isn't that like a server i was at?
=>...i thought it was ==: i could be mixing it up with another type of scripting tho.

Code: Select all

// DO NOT CHANGE THIS UNLESS YOU KNOW WHAT YOU'RE DOING
// This will change the address trough shorthand authorities will be contacted.
// Changing this setting is only useful if you're exporting AAGID to something else than armagetronad
// Shorthand authorities(those with which you don't have to type the whole name) are contacted
// by appending $rootDomain preceeded with a dot to the shorthand authority's name. Example:
// g.authentication.armagetronad.net // Here, g is the name of the shorthand authority, so
// the users can use user@g to authenticate with g.authentication.armagetronad.net
$rootDomain = 'authentication.armagetronad.net';
Im thinking this is an aready made script; am i wrong :| for some reason?
user@g? LOL :lol: !!!!
But i dont really wanna make an AUTH place. I can use the script for my clan!
Moofie
Core Dumper
Posts: 125
Joined: Fri Jan 27, 2012 1:36 am
Location: Ohio
Contact:

Re: Setting up auth server

Post by Moofie »

Lol nelg it's php, and there is an easier one for you to use if you've never seen any script like this before (http://wiki.armagetronad.org/index.php? ... ion_Server) :P. And I guess I'll have to edit the forum to make it use md5.

-Also nelg, the shenanaboosh thing is the language in my server (which you were probably at), it's just something my friend and I thought our other friend said, when really it was some french thing (it was hilarious at the time, we love it too much to not use)
Moofie
Core Dumper
Posts: 125
Joined: Fri Jan 27, 2012 1:36 am
Location: Ohio
Contact:

Re: Setting up auth server

Post by Moofie »

Alright, its close. Now all I got was a password_fail, so atleast its querying the server. In the db there is a passwordSalt column, trying to figure out where to put it because if my understanding of encryption is right that decrypts it..
User avatar
Phytotron
Formerly Oscilloscope
Posts: 5041
Joined: Thu Jun 09, 2005 10:06 pm
Location: A site or situation, especially considered in regard to its surroundings.
Contact:

Re: Setting up auth server

Post by Phytotron »

Jip wrote:SMF (I guess it's Simple Machines Forum?)
Nope, Twisted Sister fan club.
Moofie
Core Dumper
Posts: 125
Joined: Fri Jan 27, 2012 1:36 am
Location: Ohio
Contact:

Re: Setting up auth server

Post by Moofie »

Uh huh, whatever that means. :P
Moofie
Core Dumper
Posts: 125
Joined: Fri Jan 27, 2012 1:36 am
Location: Ohio
Contact:

Re: Setting up auth server

Post by Moofie »

Woot, I got it! :D I quit smf (it sucks...) and I used a few scripts that just make you a login, directed that to a database with md5 encryption, then the arma script reads that and processes your login info there.
Post Reply