Skip to content

lewsid/simple-token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

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

About

A bare-bones php token authentication class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages