• Stars
    star
    106
  • Rank 325,871 (Top 7 %)
  • Language
    PHP
  • Created over 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Authentication, authorization and access control for Slim and other micro-frameworks

jasny-banner

Jasny Auth

PHP Scrutinizer Code Quality Code Coverage Packagist Stable Version Packagist License

Authentication, authorization and access control for PHP.

Features


Installation

Install using composer

composer require jasny/auth

Usage

Auth is a composition class. It takes an authz, storage, and optionally a confirmation service.

use Jasny\Auth\Auth;
use Jasny\Auth\Authz\Levels;

$levels = new Levels(['user' => 1, 'moderator' => 10, 'admin' => 100]);
$auth = new Auth($levels, new AuthStorage());

session_start();
$auth->initialize();

// Later...
if (!$auth->is('admin')) {
    http_response_code(403);
    echo "Access denied";
    exit();
}

The Auth service isn't usable until it's initialized. This should be done after the session is started.

session_start();
$auth->initialize();

Documentation

More Repositories

1

bootstrap

The missing components for your favorite front-end framework.
JavaScript
2,683
star
2

sso

Simple Single Sign-On for PHP
PHP
1,473
star
3

jquery.smartbanner

Smart Banner support for iOS 4/5 and Android
JavaScript
649
star
4

twig-extensions

A number of useful filters for Twig
PHP
103
star
5

switch-route

Generate a PHP script for faster routing πŸš€
PHP
75
star
6

mysql-revisioning

PHP script to add versioning to MySQL data
PHP
69
star
7

audio

Process audio files using SoX
PHP
47
star
8

php-functions

A set PHP functions that SHOULD have been part of PHP's core libraries.
PHP
43
star
9

persist-sql-query

The best and most complete query builder/parser for MySQL (PHP)
PHP
32
star
10

phpdoc-parser

Extract meta data from DocBlock comments in PHP
PHP
32
star
11

dbvc

Manage database updates using version control
PHP
24
star
12

skeleton-php-ext

Skeleton project for PHP extension (written in C)
PowerShell
24
star
13

developer-access

Private/public key authentication in PHP
PHP
23
star
14

http-message

PSR-7 for new and legacy applications
PHP
22
star
15

http-message-php-ext

PSR-7 implementation as PHP extension (pecl)
PHP
21
star
16

formbuilder

A form builder for HTML5 and Twitter Bootstrap
PHP
20
star
17

config

Configure your application in PHP, with PSR-11 implementation
PHP
20
star
18

iso

PHP library around standarized codes
PHP
19
star
19

oauth-lambda

AWS Lambda function for GitHub OAuth authentication
HTML
17
star
20

invite-code

Library for using invitation codes (PHP)
PHP
16
star
21

persist-core

Service based DB abstraction layer for PHP
PHP
15
star
22

base58-php-ext

PHP extension for base58 encoding and decoding using the Bitcoin alphabet
PowerShell
15
star
23

dotkey

Access objects and arrays through dot notation
PHP
14
star
24

improved-php-iterable

Functions working with arrays, Iterators and other Traversable objects (PHP)
PHP
14
star
25

db-mysql

A simple class for using MySQL
PHP
13
star
26

lib-phpdebug-js

XDebug (PHP Debugger) client written in JavaScript
JavaScript
11
star
27

http-signature

PHP library for HTTP Signature IETF draft standard RFC
PHP
9
star
28

typecast

Strict type casting for PHP
PHP
7
star
29

event-loop

A simple event loop implementation for PHP
PHP
7
star
30

error-handler

Error handler with PSR-7 support
PHP
6
star
31

mvc

The basics for an MVC application
PHP
5
star
32

jasny-symfony

No longer maintained
PHP
5
star
33

db-mongo

Service based DB abstraction layer for PHP (MongoDB)
PHP
5
star
34

php-code-quality

Coding standard and quality assurance checks (PHP)
5
star
35

visiting-hours

Let your guests select visiting hours
JavaScript
4
star
36

improved-php-function

Library for function handling and functional programming (PHP)
PHP
4
star
37

improved-php-type

Type checking and casting (PHP)
PHP
4
star
38

phpunit-xsdvalidation

XSD schema validation constraint for PHPUnit
PHP
4
star
39

validation-result

A result object for validation (PHP)
PHP
4
star
40

woocommerce-login-redirect-to

Support for `redirect_to` query parameter to specify a redirect page after login via WooCommerce user profile page
PHP
4
star
41

autowire

Autowiring for PSR-11 containers
PHP
3
star
42

Q

Old but sometimes useful code
PHP
3
star
43

immutable

Helper method for immutable objects
PHP
3
star
44

container

PSR-11 compatible container with sub-container and autowiring support (PHP)
PHP
3
star
45

php-consistent-function-names

Userland implementation of PHP RFC: Consistent Function Names
PHP
3
star
46

formbuilder-bootstrap

Bootstrap decorator for Jasny Form builder
PHP
3
star
47

view

An abstraction for using PSR-7 with template engines
PHP
2
star
48

paypal-csv-local-currency

Convert foreign currencies in a PayPal CSV export
HTML
2
star
49

write-protection-php-ext

Write protected objects in PHP (experimental)
PowerShell
2
star
50

varcache

A 500x faster cache implementation for PHP
PHP
2
star
51

substitution.js

JavaScript library to substitute placeholders in a string
JavaScript
2
star
52

envelope-milter

Sendmail/postfix pre-queue filter to check envelope sender against To header
C
2
star
53

db-rest

Database layer for RESTful services
PHP
2
star
54

entity

An entity is an object with a (persistent) data representation.
PHP
2
star
55

event-dispatcher

PSR-14 compatible event dispatcher that's easy to use
PHP
2
star
56

reflection-factory

Abstract factory for PHP Reflection
PHP
2
star
57

phpunit-extension

Additional PHPUnit assertions and helper functions
PHP
2
star
58

meta

Define metadata for classes, properties and functions
PHP
1
star
59

SpotifyThis

Chrome plugin that adds a Spotify Play Button when on an artist page
JavaScript
1
star
60

consolekit-extension

An extension to maximebf/consolekit
PHP
1
star
61

php-rfc-strict-operators

PHP RFC: Strict operators directive
1
star
62

knex-hdb

SAP Hana support for Knex.js
JavaScript
1
star
63

router

A versatile router for PHP
PHP
1
star
64

improved-php-string

Don't look at me. I'm not ready yet!
PHP
1
star
65

session-middleware

PSR-15 session middleware
PHP
1
star
66

reset-php.ini

Set PHP ini configuration that changes runtime behavior to standard values
PHP
1
star
67

persist-orm

ORM/ODM for Jasny Persist
PHP
1
star
68

mongodb-northwind

MongoDB version of Northwind demo database
JavaScript
1
star
69

social

A cool web service API abstraction layer for PHP
PHP
1
star
70

forwarded-middleware

Middleware to handle the Forwarded header for trusted proxies (PHP)
PHP
1
star
71

utf8-php-ext

UTF-8 string functions for PHP
PHP
1
star
72

firewall

A very simple firewall script
Shell
1
star
73

improved-php

Consistent, modern and safe functions (PHP) - meta package
1
star