A bare-bones php token authentication class
PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md formatting Sep 24, 2014
SimpleToken.php first commit of the basic version Sep 24, 2014
example.php first commit of the basic version Sep 24, 2014

README.md

simple-token v0.01

A bare-bones php token authentication class

Features

simple token requires nothing more than a base installation of PHP 5.3 and can be easily adapted for use in an API.

Usage

  1. Generate a key to store on each end

    $key = SimpleToken::generateKey();
  2. Generate a token to be passed from one end to the other. This token will be good for until the end of the current day. There's a better way to do this, and I'll certainly come back and make it so, someday.

    $token = SimpleToken::generateToken($key, $content);
  3. Verify the authenticity of the transaction.

    if(SimpleToken::isAuthentic($key, $content, $token))
    {
    	echo 'Valid';
    }
    else
    {
    	echo 'Invalid';
    }

License

simple-token is open-sourced software licensed under the MIT License.

Contact