happytodev / authentik
A package for TempestPHP to handle OAuth authentication with providers like GitHub, Amazon and others to come.
v1.0.0
2025-07-06 22:50 UTC
Requires
- php: ^8.4
- guzzlehttp/guzzle: ^7.0
- league/oauth2-client: ^2.6
- league/oauth2-github: ^3.0
- tempest/auth: ^1.0
- tempest/core: ^1.0
- tempest/framework: ^1.0
README
A package for TempestPHP to handle OAuth authentication with providers like
- GitHub
- X
- Amazon
Prerequisites
- TempestPHP installed
- TempestPHP Auth package installed
- Database setup
- OAuth provider credentials (Client ID, Client Secret, Redirect URI)
Installation
You can install the package via composer:
composer require happytodev/authentik
As Tempest Auth User's model is final, you need to extend it and add the OauthFieldsTrait to your User model.
Just add the following use OauthFieldsTrait;
to your User model:
final class User implements CanAuthenticate, CanAuthorize { use IsDatabaseModel; use OauthFieldsTrait; // Add the trait here ...
Migration
Run the following command to add the necessary database fields:
php tempest migrate:up
.env settings
Configure your .env file with the necessary settings:
# Possible values: local, staging, production, ci, testing, other ENVIRONMENT=local # The base URI that's used for all generated URIs BASE_URI=https://mytempestsite.test GITHUB_CLIENT_ID=Ov23liz............. GITHUB_CLIENT_SECRET=14a................................... GITHUB_REDIRECT_URI=${BASE_URI}/auth/github/callback AMAZON_CLIENT_ID='amzn1.application-oa2-client.ca50............................' AMAZON_CLIENT_SECRET='amzn1.oa2-cs.v1.ed9a............................................................' AMAZON_REDIRECT_URI=${BASE_URI}/auth/amazon/callback # After success oauth authentication, route to redirect to AUTHENTIK_REDIRECT_URI=${BASE_URI}/admin
Usage
Create link to the login page in your view by calling the following address :
License
The MIT License (MIT). Please see License File for more information.