Repository: goauthentik/authentik

Issue:
Provides documentation to intergrate Traefik with non Oauth/SAML2 like services.
**Is your feature request related to a problem? Please describe.**
no

**Describe the solution you'd like**
Provides docs to intergrate Authentik with traefik behind non oauth/saml services.

**Describe alternatives you've considered**
The only doc I can find is Nginx, traefik is not avaiable

**Additional context**

See [here](https://github.com/authelia/authelia/blob/master/docs/deployment/supported-proxies/traefik2.x.md) for refference. Authelia is an example for this.



Discussion:

Resolving patch:
diff --git a/authentik/providers/proxy/api.py b/authentik/providers/proxy/api.py
--- a/authentik/providers/proxy/api.py
+++ b/authentik/providers/proxy/api.py
@@ -52,6 +52,7 @@ class Meta:
             "basic_auth_enabled",
             "basic_auth_password_attribute",
             "basic_auth_user_attribute",
+            "forward_auth_mode",
         ]
 
 
@@ -86,6 +87,7 @@ class Meta:
             "basic_auth_enabled",
             "basic_auth_password_attribute",
             "basic_auth_user_attribute",
+            "forward_auth_mode",
         ]
 
     @swagger_serializer_method(serializer_or_field=OpenIDConnectConfigurationSerializer)
diff --git a/authentik/providers/proxy/migrations/0011_proxyprovider_forward_auth_mode.py b/authentik/providers/proxy/migrations/0011_proxyprovider_forward_auth_mode.py
new file mode 100644
--- /dev/null
+++ b/authentik/providers/proxy/migrations/0011_proxyprovider_forward_auth_mode.py
@@ -0,0 +1,35 @@
+# Generated by Django 3.2 on 2021-04-27 18:47
+
+from django.db import migrations, models
+
+import authentik.lib.models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ("authentik_providers_proxy", "0010_auto_20201214_0942"),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name="proxyprovider",
+            name="forward_auth_mode",
+            field=models.BooleanField(
+                default=False,
+                help_text="Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with internal_host.",
+            ),
+        ),
+        migrations.AlterField(
+            model_name="proxyprovider",
+            name="internal_host",
+            field=models.TextField(
+                blank=True,
+                validators=[
+                    authentik.lib.models.DomainlessURLValidator(
+                        schemes=("http", "https")
+                    )
+                ],
+            ),
+        ),
+    ]
diff --git a/authentik/providers/proxy/models.py b/authentik/providers/proxy/models.py
--- a/authentik/providers/proxy/models.py
+++ b/authentik/providers/proxy/models.py
@@ -42,7 +42,8 @@ class ProxyProvider(OutpostModel, OAuth2Provider):
     Protocols by using a Reverse-Proxy."""
 
     internal_host = models.TextField(
-        validators=[DomainlessURLValidator(schemes=("http", "https"))]
+        validators=[DomainlessURLValidator(schemes=("http", "https"))],
+        blank=True,
     )
     external_host = models.TextField(
         validators=[DomainlessURLValidator(schemes=("http", "https"))]
@@ -52,6 +53,13 @@ class ProxyProvider(OutpostModel, OAuth2Provider):
         help_text=_("Validate SSL Certificates of upstream servers"),
         verbose_name=_("Internal host SSL Validation"),
     )
+    forward_auth_mode = models.BooleanField(
+        default=False,
+        help_text=_(
+            "Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with "
+            "internal_host."
+        ),
+    )
 
     skip_path_regex = models.TextField(
         default="",


Test patch: