Compare commits

..

3 Commits
v0.9.0 ... main

Author SHA1 Message Date
ce72d28912 updated readme
Some checks failed
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, ubuntu-latest, 8.1, prefer-lowest, 8.*) (push) Has been cancelled
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, ubuntu-latest, 8.1, prefer-stable, 8.*) (push) Has been cancelled
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, ubuntu-latest, 8.2, prefer-lowest, 8.*) (push) Has been cancelled
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, ubuntu-latest, 8.2, prefer-stable, 8.*) (push) Has been cancelled
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, windows-latest, 8.1, prefer-lowest, 8.*) (push) Has been cancelled
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, windows-latest, 8.1, prefer-stable, 8.*) (push) Has been cancelled
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, windows-latest, 8.2, prefer-lowest, 8.*) (push) Has been cancelled
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, windows-latest, 8.2, prefer-stable, 8.*) (push) Has been cancelled
2025-11-11 22:45:47 +00:00
f3b226a0fd updated package description 2025-11-11 22:45:40 +00:00
7bbf7f68e4 upgradet to filamentphp 4
Some checks failed
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, ubuntu-latest, 8.1, prefer-lowest, 8.*) (push) Waiting to run
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, ubuntu-latest, 8.1, prefer-stable, 8.*) (push) Waiting to run
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, ubuntu-latest, 8.2, prefer-lowest, 8.*) (push) Waiting to run
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, ubuntu-latest, 8.2, prefer-stable, 8.*) (push) Waiting to run
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, windows-latest, 8.1, prefer-lowest, 8.*) (push) Waiting to run
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, windows-latest, 8.1, prefer-stable, 8.*) (push) Waiting to run
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, windows-latest, 8.2, prefer-lowest, 8.*) (push) Waiting to run
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, windows-latest, 8.2, prefer-stable, 8.*) (push) Waiting to run
Fix PHP Code Styling / php-code-styling (push) Has been cancelled
PHPStan / phpstan (push) Has been cancelled
2025-11-11 22:28:38 +00:00
4 changed files with 29 additions and 6 deletions

View File

@ -5,9 +5,31 @@
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/alexandergabriel/filament-oauth2/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/alexandergabriel/filament-oauth2/actions?query=workflow%3A"Fix+PHP+code+styling"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/alexandergabriel/filament-oauth2.svg?style=flat-square)](https://packagist.org/packages/alexandergabriel/filament-oauth2)
> !!!
> This Plugin is still under development and only tested with Keycloak.
> This is my first FilamentPHP-Plugin.
> Did not write any tests, not published to packagist yet...
> Feedback welcome.
> !!!
To be able to install you have to add/change this to/in your composer.json:
```json
{
"minimum-stability": "dev",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/AlexanderGabriel/filament-oauth2"
}
]
}
```
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
This Plugin enables OAuth2-Login for [FilamentPHP](https://filamentphp.com) Panels.
Login and logout is done by OAuth2-Server.
If the OAuth2-Server provides roles for your client, they will be mapped to the App\Models\Role-Model
Non-existing Roles will be created.
Users will be detached to roles not in the access token any more.
## Installation
@ -106,6 +128,7 @@ Please review [our security policy](../../security/policy) on how to report secu
## Credits
- To all helping developing and keeping alive FilamentPHP, PHP, OAuth2 and the OpenSource Ecosystem!
- [Alexander Gabriel](https://github.com/AlexanderGabriel)
- [All Contributors](../../contributors)

View File

@ -1,6 +1,6 @@
{
"name": "alexandergabriel/filament-oauth2",
"description": "This is my package filament-oauth2",
"description": "Enable OAuth2 Authentication to FilamentPHP Panels",
"keywords": [
"AlexanderGabriel",
"laravel",
@ -21,7 +21,7 @@
],
"require": {
"php": "^8.1",
"filament/filament": "^3.0",
"filament/filament": "^4.0",
"league/oauth2-client": "*",
"spatie/laravel-package-tools": "^1.15.0"
},

View File

@ -6,7 +6,7 @@ use AlexanderGabriel\FilamentOauth2\Http\Controllers\Oauth2Controller;
use Filament\Facades\Filament;
use Illuminate\Support\Facades\Route;
$panel = Filament::getCurrentPanel();
$panel = Filament::getCurrentOrDefaultPanel();
Route::prefix($panel->getPath())
->middleware($panel->getMiddleware())
@ -15,7 +15,7 @@ Route::prefix($panel->getPath())
Route::name('filament-oauth2.')
->prefix('filament-oauth2')
->group(function () {
Route::post('handleLogout', [Oauth2Controller::class, 'handleLogout'])->name('handleLogout');
Route::get('handleLogout', [Oauth2Controller::class, 'handleLogout'])->name('handleLogout');
Route::get('redirectToOauth2Server', [Oauth2Controller::class, 'redirectToOauth2Server'])
->name('redirectToOauth2Server');
Route::get('handleCallback', [Oauth2Controller::class, 'handleCallback'])

View File

@ -7,8 +7,8 @@ use App\Models\Role;
use App\Models\User;
use Illuminate\Validation\ValidationException;
use Exception;
use Filament\Auth\Http\Responses\LoginResponse;
use Filament\Facades\Filament;
use Filament\Http\Responses\Auth\LoginResponse;
use Filament\Models\Contracts\FilamentUser;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;