A simple auth system with integrated hwd check designed to be fast and friendly for your XenForo Forum.
- 1.Put auth.php inside your webroot where xenforo is located.
- 2.Create a new config.json in /var/config/ (Or change easily the path in auth.php)
{
"SQL_HOST": "localhost",
"SQL_USER": "root",
"SQL_PASS": "password",
"SQL_DB": "db",
"MASTER_KEY": "dontsharethiskey",
"FORUM_URL": "https://yourforum.de/forum/"
}
- 3.Create a new table in forum db named xf_user_info
CREATE TABLE xf_user_info (
user_id INT PRIMARY KEY,
hwid VARCHAR(255) NOT NULL
);
Use the examples i made or read down below how to make a request.
GET auth.php?status
Response | Type | Description |
---|---|---|
200 |
json |
Will return 200 if everything is fine |
POST auth.php?compare
Parameter | Type | Description |
---|---|---|
username |
string |
Required |
password |
string |
Required |
hwid |
string |
Required |
Send in application/x-www-form-urlencoded
format.
private static readonly string apiurl = "https://yourforum.de/auth.php";
// Define API Url
Check if API is reachable
bool StatusCheck = await XenAuth.XenAuth.Status(apiurl);
Console.WriteLine(StatusCheck);
// Returns true if connected.
Logging in
int login = await XenAuth.XenAuth.Compare("username", "password", apiurl);
// Returns the Response Code
A simple Example
using XenAuth;
static void Main(string[] args)
{
Console.WriteLine("Status: " + XenAuth.XenAuth.Status("https://yourforum.de/auth.php").Result);
Console.WriteLine("Logging in: " + XenAuth.XenAuth.Compare("username", "password", "https://yourforum.de/auth.php").Result);
Console.ReadKey();
}
Hope you like my first public project i will try to maintain. If you have questions or want to contribute. ɠιɳ#7777 my discord.