Download the PHP package keystackapp/keystack-php-auth without Composer

On this page you can find all versions of the php package keystackapp/keystack-php-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 keystack-php-auth

PHP-encryptor

Keystack-php-auth is a small PHP library created for keystack.app. This library provides functionalities to extract payloads from API keys, encrypt API keys, and create login input data from API keys for authentication purposes.

Installation

You can install the keystack-php-auth library via Composer:

Usage

Below are examples demonstrating how to use the library:

Extracting API Key Payload To extract the payload from a Keystack API key, use the ApiKeyExtractor class:

Encrypting API Key

To get the encrypted API key from the API key token, use the KeyEncryptor class:

Creating Login Input Data

To create the login input data from the API key, use the CredentialExtractor class. This is the main functionality of the library, allowing the creation of login data from the API key for authentication:

Token Storage Adapters

This library includes a set of pluggable adapters for storing short-lived JWT tokens and tracking login attempts. All adapters implement the same contract: KeyStackApp\Adapter\TokenStorageAdapterInterface.

Interface methods:

You can choose the adapter that fits your environment or implement your own.

SessionAdapter (PHP native sessions)

Namespace: KeyStackApp\Adapter\SessionAdapter

Constructor:

Example:

Notes:

FileAdapter (filesystem)

Namespace: KeyStackApp\Adapter\FileAdapter

Constructor:

Example:

Notes:

RedisAdapter

Namespace: KeyStackApp\Adapter\RedisAdapter

Constructor:

Behavior:

Example:

Notes:

DatabaseAdapter (PDO)

Namespace: KeyStackApp\Adapter\DatabaseAdapter

Constructor:

Schema (created automatically if missing):

Example:

Notes:

WPTransientAdapter (WordPress)

Namespace: KeyStackApp\Adapter\WPTransientAdapter

Constructor:

Example:

Notes:

Implementing a custom adapter

1) Create a class that implements KeyStackApp\Adapter\TokenStorageAdapterInterface. 2) Implement all required methods to match your storage backend (memcached, Laravel cache, etc.). 3) Keep tokens short-lived and clear them when no longer needed.

Skeleton:

Security considerations

License

This project is licensed under the MIT License. See the LICENSE file for details.


All versions of keystack-php-auth with dependencies

PHP Build Version
Package Version
Requires phpseclib/phpseclib Version ~3.0
symfony/http-client Version ^7.3
guzzlehttp/promises Version ^2.3
keystackapp/keystack-php-auth-client Version ^0.0.1
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 keystackapp/keystack-php-auth contains the following files

Loading the files please wait ...