Download the PHP package luk-z/php-api-token-auth without Composer

On this page you can find all versions of the php package luk-z/php-api-token-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-api-token-auth

Php Api Token Authentication

This library is based on https://www.yiiframework.com/wiki/2568/jwt-authentication-tutorial

Install

Composer

Manual

Donwload ad extract source code from github, then include in you project:

Run test

Use in project

TODO

PHP CS Fixer

To use correctly PHP CS Fixer copy settings.json-example to settings.json and insert absolute path of tools/php-cs-fixer/vendor/bin/php-cs-fixer to php-cs-fixer.executablePath

Release

Repository is linked to packagist through (github web hook)[https://packagist.org/about#how-to-update-packages]. To push an update simply push a tag.

Functions

PATA::init()

Initialize the library passing dome configuration information.

Params: TODO

Returns: void

PATA::authenticate()

Take an access token and check if is valid/not expired

Params:

Returns:

PATA::refreshToken()

Takes an access token and refresh token and try to refresh a new access token. If refreshToken not passed try to get from cookies

Params:

Returns:

PATA::activate()

Searches provided activation token and check validity then set user activated and set activation token expired

Params:

Returns:

PATA::registerUser()

Creates a user with given email and password then send activation email. If user already exists.

Params:

Returns:

PATA::loginUser()

Check provided credentials then create a user session with refresh token, access token and session id. If provided credentials are wrong or usr isn't activated return an error

Params:

Returns:

PATA::logoutUser()

First executes authenticate() to check accessToken then delete user tokens associated to a specific sid

Params:

Returns:

PATA::forgotPassword()

Check if email exists then send email with change password link (only if user is activated)

  1. check email is valid
  2. find active user
  3. find change password tokens
    1. if expired, delete it
    2. if not expired return error

Params:

Returns:

PATA::changePassword()

Check if password and token are valid then burn token and change password of the associated user (only if user is activated):

  1. check password is valid
  2. check token is valid and not expired
  3. check user is active
  4. check password is changed
  5. change password in db
  6. burn token

Params:

Returns:

Developing

Install php-cs-fixer

Usefull guides:


All versions of php-api-token-auth with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package luk-z/php-api-token-auth contains the following files

Loading the files please wait ....