PHPackages                             duelistrag3/php-wowemu-auth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. duelistrag3/php-wowemu-auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

duelistrag3/php-wowemu-auth
===========================

Wowemu compliant SRP6 auth implementation

v1.0.1(4y ago)07GPL-3.0-or-laterPHPPHP &gt;=7.1

Since Jul 26Pushed 4y agoCompare

[ Source](https://github.com/DuelistRag3/php-wowemu-auth)[ Packagist](https://packagist.org/packages/duelistrag3/php-wowemu-auth)[ RSS](/packages/duelistrag3-php-wowemu-auth/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (4)Used By (0)

php-wowemu-auth
===============

[](#php-wowemu-auth)

Requirements
------------

[](#requirements)

- PHP 7.1+
- Web server (ex. Apache or Nginx)
- CMaNGOS instance

Installation
------------

[](#installation)

You can install the libary via composer:

```
composer require duelistrag3/php-wowemu-auth
```

Usage
-----

[](#usage)

### Register

[](#register)

First you'll want to use Composer's `autoloader`. Place this at the top of your script.

```
require_once __DIR__ . '/vendor/autoload.php';
use Duelistrag3\Wowemu\SRP\UserClient;
```

Next you'll need to create the verifier and salt values using the username and password which your user submitted on your registration form.

```
$client = new UserClient($username);
$salt = $client->generateSalt();
$verifier = $client->generateVerifier($password);
```

Once that is generated you'll just insert those values into the database to the `v` and `s` fields.

### Login

[](#login)

First you'll want to use Composer's `autoloader`. Place this at the top of your script.

```
require_once __DIR__ . '/vendor/autoload.php';
use Duelistrag3\Wowemu\SRP\UserClient;
```

Next you'll need to generate your "verifier". Think of this as the hashed version of the password your user put into the password field of you login form.

```
$client = new UserClient($username, $saltFromDatabase);
$verifier = strtoupper($client->generateVerifier($password));
```

Next you'll want to compare that value with the value stored in your CMaNGOS `realmd.account` table. You can see below for more of an example.

Examples
--------

[](#examples)

### Register

[](#register-1)

This example goes over how a user can register via a web form.

```
