Download the PHP package vielhuber/simpleauth without Composer

On this page you can find all versions of the php package vielhuber/simpleauth. 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 simpleauth

build status GitHub Tag Code Style License Last Commit PHP Version Support Packagist Downloads

🔒 simpleauth 🔒

simpleauth is a simple php based authentication library.

it leverages:

installation

install once with composer:

now simply create the following files inside a new folder called auth inside your public directory:

/auth/index.php

/auth/.htaccess

/.env

create a jwt secret (openssl rand -base64 64 | tr -d '\n' | xclip -selection clipboard)\ and populate an .env file:

if you want to migrate and seed data, simply run

and you should be done (a test user '[email protected]' with the password 'secret' is created).\ you can now fully authenticate with the routes below.\ if you want to authenticate via username instead of email, simply change login to 'username'.\ if you need uuids instead of integers as your user ids, change uuid to true.

routes

the following routes are provided automatically:

route method arguments header response
/auth/login POST email password -- ([ 'success' => true, 'message' => 'auth successful', 'public_message' => '...', 'data' => [ 'access_token' => '...', 'expires_in' => 3600, 'user_id' => 42 ] ], 200)
/auth/refresh POST -- Authorization: Bearer token ([ 'success' => true, 'message' => 'auth successful', 'public_message' => '...', 'data' => [ 'access_token' => '...', 'expires_in' => 3600, 'user_id' => 42 ] ], 200)
/auth/logout POST -- Authorization: Bearer token ([ 'success' => true, 'message' => 'logout successful', 'public_message' => '...' ], 200)
/auth/check POST access_token -- ([ 'success' => true, 'message' => 'valid token', 'public_message' => '...', 'data' => [ 'expires_in' => 3600, 'user_id' => 42, 'client_id' => 7000000 ] ], 200)

tests

further usage

you can use the following functions inside your own application (they do not need any database lookups):

frontend

if you need a neat frontend library that works together with simpleauth seemlessly, try out jwtbutler.


All versions of simpleauth with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
vielhuber/dbhelper Version ^2.4.8
firebase/php-jwt Version ^7.0.5
vielhuber/comparehelper Version ^1.1.9
guzzlehttp/guzzle Version ^7.10.3
vlucas/phpdotenv Version ^5.6.3
web-auth/webauthn-lib Version ^5.3
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 vielhuber/simpleauth contains the following files

Loading the files please wait ...