Skip to content

Commit

Permalink
Added Authentik support (#2714)
Browse files Browse the repository at this point in the history
  • Loading branch information
nanawel authored Nov 20, 2024
1 parent f6eb39e commit c24e0f5
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
# MICROSOFT_CLIENT_SECRET=
# MICROSOFT_REDIRECT_URI=/auth/microsoft/redirect

# NEXTCLOUD_CLIENT_ID=
# NEXTCLOUD_CLIENT_SECRET=
# NEXTCLOUD_CLIENT_ID=
# NEXTCLOUD_CLIENT_SECRET=
# NEXTCLOUD_REDIRECT_URI=/auth/nextcloud/redirect
# NEXTCLOUD_BASE_URI=

Expand All @@ -175,6 +175,11 @@ VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
# KEYCLOAK_BASE_URL=
# KEYCLOAK_REALM=

# AUTHENTIK_BASE_URL=
# AUTHENTIK_CLIENT_ID=
# AUTHENTIK_CLIENT_SECRET=
# AUTHENTIK_REDIRECT_URI=/auth/authentik/redirect

# AWS support data

# AWS_ACCESS_KEY_ID=
Expand Down
1 change: 1 addition & 0 deletions app/Enum/OauthProvidersType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ enum OauthProvidersType: string

case AMAZON = 'amazon';
case APPLE = 'apple';
case AUTHENTIK = 'authentik';
case FACEBOOK = 'facebook';
case GITHUB = 'github';
case GOOGLE = 'google';
Expand Down
2 changes: 2 additions & 0 deletions app/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use SocialiteProviders\Amazon\AmazonExtendSocialite;
use SocialiteProviders\Apple\AppleExtendSocialite;
use SocialiteProviders\Authentik\AuthentikExtendSocialite;
use SocialiteProviders\Facebook\FacebookExtendSocialite;
use SocialiteProviders\GitHub\GitHubExtendSocialite;
use SocialiteProviders\Google\GoogleExtendSocialite;
Expand All @@ -28,6 +29,7 @@ class EventServiceProvider extends ServiceProvider
SocialiteWasCalled::class => [
AmazonExtendSocialite::class . '@handle',
AppleExtendSocialite::class . '@handle',
AuthentikExtendSocialite::class . '@handle',
FacebookExtendSocialite::class . '@handle',
GitHubExtendSocialite::class . '@handle',
GoogleExtendSocialite::class . '@handle',
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"revolution/socialite-mastodon": "^1.4",
"socialiteproviders/amazon": "^4.1",
"socialiteproviders/apple": "^5.6",
"socialiteproviders/authentik": "^5.2",
"socialiteproviders/facebook": "^4.1",
"socialiteproviders/github": "^4.1",
"socialiteproviders/google": "^4.1",
Expand Down
52 changes: 51 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@
'redirect' => env('APPLE_REDIRECT_URI', '/auth/apple/redirect'),
],

'authentik' => [
'client_id' => env('AUTHENTIK_CLIENT_ID'),
'client_secret' => env('AUTHENTIK_CLIENT_SECRET'),
'redirect' => env('AUTHENTIK_REDIRECT_URI'),
'base_url' => env('AUTHENTIK_BASE_URL'),
],

'facebook' => [
'client_id' => env('FACEBOOK_CLIENT_ID'),
'client_secret' => env('FACEBOOK_CLIENT_SECRET'),
Expand Down
12 changes: 11 additions & 1 deletion resources/js/lychee.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,17 @@ declare namespace App.Enum {
| "CC-BY-NC-SA-3.0"
| "CC-BY-NC-SA-4.0";
export type MapProviders = "Wikimedia" | "OpenStreetMap.org" | "OpenStreetMap.de" | "OpenStreetMap.fr" | "RRZE";
export type OauthProvidersType = "amazon" | "apple" | "facebook" | "github" | "google" | "mastodon" | "microsoft" | "nextcloud" | "keycloak";
export type OauthProvidersType =
| "amazon"
| "apple"
| "authentik"
| "facebook"
| "github"
| "google"
| "mastodon"
| "microsoft"
| "nextcloud"
| "keycloak";
export type OrderSortingType = "ASC" | "DESC";
export type PhotoLayoutType = "square" | "justified" | "unjustified" | "masonry" | "grid";
export type SeverityType = "emergency" | "alert" | "critical" | "error" | "warning" | "notice" | "info" | "debug";
Expand Down
2 changes: 2 additions & 0 deletions resources/js/services/oauth-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const OauthService = {
return "fa-brands fa-apple";
case "amazon":
return "fa-brands fa-amazon";
case "authentik":
return "fa-brands fa-key";
case "facebook":
return "fa-brands fa-facebook";
case "github":
Expand Down

0 comments on commit c24e0f5

Please sign in to comment.