diff --git a/configuration/auth.html b/configuration/auth.html index 371f497..57f0f9d 100644 --- a/configuration/auth.html +++ b/configuration/auth.html @@ -169,9 +169,30 @@ VALUES 'database' => 'filegator', ], ], -

Custom Authentication using 3rd party (WordPress or similar)

+

Configuring Auth service to use WordPress

+

Replace your current Auth handler in configuration.php file like this:

+
        'Filegator\Services\Auth\AuthInterface' => [
+            'handler' => '\Filegator\Services\Auth\Adapters\WPAuth',
+            'config' => [
+                'wp_dir' => '/var/www/my_wordpress_site/',
+                'permissions' => ['read', 'write', 'upload', 'download', 'batchdownload', 'zip'],
+                'private_repos' => false,
+            ],
+        ],
+

Adjust in the config above:

+ +

Note: With more recent versions of FileGator you can set guest_redirection in your configuration.php to redirect logged-out users back to your WP site:

+
'frontend_config' => [
+  ...
+    'guest_redirection' => 'http://example.com/wp-admin/',
+  ...
+]
+

Custom Authentication using 3rd party

If you want to use FileGator as a part of another application, you probably already have users stored somewhere else. What you need in this case is to build a new custom Auth adapter that matches the AuthInterface to connect those two. This new adapter will try to authenticate users in your application and translate each user into filegator User object.

-

You can look at this simple WordPress auth adapter to see how all this works.

API authentication

Front-end will use session based authentication to authenticate and consume the back-end.

Note: The application will not work if you disable cookies.

diff --git a/configuration/basic.html b/configuration/basic.html index 06910c7..fcb2de8 100644 --- a/configuration/basic.html +++ b/configuration/basic.html @@ -144,6 +144,7 @@ 'default_archive_name' => 'archive.zip', 'editable' => ['.txt', '.css', '.js', '.ts', '.html', '.php'], 'date_format' => 'YY/MM/DD hh:mm:ss', // see: https://momentjs.com/docs/#/displaying/format/ + 'guest_redirection' => '', // useful for external auth adapters ],

Additional HTML

You can add additional html to the head and body like this:

diff --git a/index.html b/index.html index 94cd68b..992d417 100644 --- a/index.html +++ b/index.html @@ -145,7 +145,7 @@

Features & Goals