Download the PHP package latinexus/lx_auth without Composer

On this page you can find all versions of the php package latinexus/lx_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 lx_auth

LxAuth - Sistema de Autenticación y Autorización

Librería PHP para autenticación, roles y permisos. Trabaja contra una única base de datos por instancia. Ideal para arquitecturas SaaS donde cada cliente (tenant) tiene su propia base de datos.

Nota: La resolución del tenant (cliente) y sus credenciales de conexión son responsabilidad de la aplicación que consume LX_AUTH. LX_AUTH recibe una conexión ya configurada y opera exclusivamente contra ella.

🚀 Características

📋 Requisitos

🛠️ Instalación

🗄️ Esquema de Base de Datos

Cada base de datos donde opere LX_AUTH debe tener las siguientes tablas:

Tabla Descripción
users Usuarios del sistema
roles Roles jerárquicos
permissions Permisos con wildcards
role_user Relación usuarios-roles
permission_role Relación roles-permisos
permission_user Permisos directos a usuarios
persistences Sesiones persistentes

Migraciones

🔧 Configuración Básica

📚 Uso Básico

Autenticación

Roles y Permisos

Middleware PSR-15

$tenantId = $auth->getTenantResolver()->resolve(); bash

Tests básicos (SQLite en memoria)

php test_simple.php # Test básico del modelo php test_final.php # Test de compatibilidad completa php test_migrations.php # Test de migraciones con datos

Tests específicos para MySQL/MariaDB

php test_mysql.php # Test completo con MySQL/MariaDB

Migraciones

php migrate.php # Migraciones SQLite (desarrollo) php migrate_mysql.php # Migraciones MySQL/MariaDB (producción)

src/ ├── LxAuth.php # Clase principal ├── Models/ # Modelos Eloquent │ ├── User.php │ ├── Role.php │ ├── Permission.php │ └── Tenant.php ├── Services/ # Servicios del sistema │ ├── AuthManager.php │ ├── RoleManager.php │ ├── PermissionManager.php │ └── TenantResolver.php ├── Middleware/ # Middleware PSR-15 ├── Drivers/ # Drivers de base de datos └── Contracts/ # Interfaces y contratos

config/ └── lx_auth.php # Configuración

database/ └── migrations/ # Migraciones de base de datos

tests/ # Tests unitarios bash php -r "echo bin2hex(random_bytes(32));"



- Sugerencia de despliegue/rotación:
  - Considera soportar temporalmente una clave secundaria (`jwt.secret_secondary`) para permitir una rotación segura sin invalidar sesiones inmediatamente; valida primero con la primaria y, si falla, intenta la secundaria.
  - Registra y renueva tokens firmados con la clave secundaria durante el período de transición.

- Validaciones añadidas en LxAuth:
  - `AuthManager` ahora valida la longitud del secret antes de llamar a la librería y sincroniza `JWT::$leeway` desde la configuración (`tokens.jwt.leeway`). Si el secret es insuficiente, se lanzará una excepción con mensaje claro.

---

## 📄 Licencia

MIT License - Ver archivo LICENSE para detalles.

## 🤝 Contribuciones

¡Contribuciones son bienvenidas! Por favor sigue los estándares de código y testing.

---

**LxAuth** - Autenticación robusta y flexible para aplicaciones PHP modernas.

All versions of lx_auth with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-json Version *
ext-openssl Version *
ext-pdo Version *
ext-ctype Version *
firebase/php-jwt Version 7.0.*
illuminate/database Version v13.18.*
psr/container Version ^2.0
psr/http-message Version ^2.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
psr/simple-cache Version ^3.0
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 latinexus/lx_auth contains the following files

Loading the files please wait ...