Download the PHP package wamesk/laravel-auth without Composer
On this page you can find all versions of the php package wamesk/laravel-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wamesk/laravel-auth
More information about wamesk/laravel-auth
Files in wamesk/laravel-auth
Package laravel-auth
Short Description OAuth2 authorization with API endpoints. Also includes registration process, login, password reset, email validation.
License MIT
Informations about the package laravel-auth
Laravel Auth
Sanctum authorization with API endpoints.
Also includes registration process, login, password reset, email validation.
Social login
JWT social login — POST /login/{provider}
Mobile clients log in by sending a Firebase ID token. The signature is verified
against Google's public keys (firebase/php-jwt), the user + device are created (or
reused), and a Sanctum access token is returned in the 6.1.3 envelope.
Enable and configure it in config/wame-auth.php:
Set FIREBASE_PROJECT_ID in .env to your Firebase project ID. The endpoint is only
registered when social.enabled is true (default: false). Verification enforces the
RS256 signature against Google's Firebase keys, iss = https://securetoken.google.com/<project-id>,
aud = <project-id>, a non-empty sub and expiry (with a small clock-skew leeway). A user
is created on first login with a random password and the provider's name; a verified
Firebase e-mail is mirrored to email_verified_at.
Socialite OAuth flow — not functional
The browser Socialite OAuth flow is still disabled and returns HTTP 501:
GET /socialite-providers(index)GET /socialite-account/{provider}(callback)GET /socialite/redirect/{provider}(redirect)
It relies on LaravelAuthController::authUserWithOAuth2(), which issues tokens via
Laravel Passport (/oauth/token, config('passport.*')) — not installed here (the
project uses Sanctum). To restore it, migrate that token issuance to Sanctum and remove
the 501 guards in SocialiteProviderController / SocialiteAccountController. The
Passport-based "Setup OAuth2" instructions below are legacy and are not required for the
Sanctum-based auth features.
Setup
Add the service provider to array of providers in config/app.php
Make sure you have \App\Models\User class. If you have it with different namespace or classname you can change it in config/wame-auth.php
Make changes to the config/auth.php file:
Make changes to the config/passport.php file:
Make changes in migrations database/migrations/2023_01_17_074644_create_activity_log_table.php:
Optionally make changes to the config/eloquent-sortable.php file:
Run migrations
Setup OAuth2
Set passport output in .env file:
Configuration
This is the content of the file that will be published in config/wame-auth.php
Publishing Views
Publishing Translations
Modifications / Extensions
Edit/Add functions and documentation
-
create controller
AuthController.phpby following the example on the documentation below - Copy from vendor/wamesk/laravel-auth/routes/api.php to
routes/api.php
Add documentation to function Example:
app/Http/Controllers/v1/AuthController.php
Add data to login response / Edit function Example:
app/Http/Controllers/v1/AuthController.php
Example how you can add parameters to registration by using Observer:
All versions of laravel-auth with dependencies
hisorange/browser-detect Version ^5.0
laravel/socialite Version ^5.0