authentik.enterprise.providers.ws_federation.models

 1from django.db import models
 2from django.templatetags.static import static
 3from django.utils.translation import gettext_lazy as _
 4from rest_framework.serializers import Serializer
 5
 6from authentik.providers.saml.models import SAMLProvider
 7
 8
 9class WSFederationSAMLVersion(models.TextChoices):
10    """SAML Assertion version issued by a WS-Federation provider"""
11
12    SAML_1_1 = "1.1", _("SAML 1.1")
13    SAML_2_0 = "2.0", _("SAML 2.0")
14
15
16class WSFederationProvider(SAMLProvider):
17    """WS-Federation for applications which support WS-Fed."""
18
19    # Alias'd fields:
20    # - acs_url -> reply_url
21    # - audience -> realm / wtrealm
22
23    saml_version = models.TextField(
24        choices=WSFederationSAMLVersion.choices,
25        default=WSFederationSAMLVersion.SAML_2_0,
26        help_text=_(
27            "SAML assertion version to issue in the security token. Microsoft Entra ID and "
28            "classic ADFS-style relying parties typically require SAML 1.1."
29        ),
30    )
31
32    @property
33    def serializer(self) -> type[Serializer]:
34        from authentik.enterprise.providers.ws_federation.api.providers import (
35            WSFederationProviderSerializer,
36        )
37
38        return WSFederationProviderSerializer
39
40    @property
41    def icon_url(self) -> str | None:
42        return static("authentik/sources/wsfed/light.svg")
43
44    @property
45    def component(self) -> str:
46        return "ak-provider-wsfed-form"
47
48    def __str__(self):
49        return f"WS-Federation Provider {self.name}"
50
51    class Meta:
52        verbose_name = _("WS-Federation Provider")
53        verbose_name_plural = _("WS-Federation Providers")
class WSFederationSAMLVersion(django.db.models.enums.TextChoices):
10class WSFederationSAMLVersion(models.TextChoices):
11    """SAML Assertion version issued by a WS-Federation provider"""
12
13    SAML_1_1 = "1.1", _("SAML 1.1")
14    SAML_2_0 = "2.0", _("SAML 2.0")

SAML Assertion version issued by a WS-Federation provider

class WSFederationProvider(authentik.providers.saml.models.SAMLProvider):
17class WSFederationProvider(SAMLProvider):
18    """WS-Federation for applications which support WS-Fed."""
19
20    # Alias'd fields:
21    # - acs_url -> reply_url
22    # - audience -> realm / wtrealm
23
24    saml_version = models.TextField(
25        choices=WSFederationSAMLVersion.choices,
26        default=WSFederationSAMLVersion.SAML_2_0,
27        help_text=_(
28            "SAML assertion version to issue in the security token. Microsoft Entra ID and "
29            "classic ADFS-style relying parties typically require SAML 1.1."
30        ),
31    )
32
33    @property
34    def serializer(self) -> type[Serializer]:
35        from authentik.enterprise.providers.ws_federation.api.providers import (
36            WSFederationProviderSerializer,
37        )
38
39        return WSFederationProviderSerializer
40
41    @property
42    def icon_url(self) -> str | None:
43        return static("authentik/sources/wsfed/light.svg")
44
45    @property
46    def component(self) -> str:
47        return "ak-provider-wsfed-form"
48
49    def __str__(self):
50        return f"WS-Federation Provider {self.name}"
51
52    class Meta:
53        verbose_name = _("WS-Federation Provider")
54        verbose_name_plural = _("WS-Federation Providers")

WS-Federation for applications which support WS-Fed.

def saml_version(unknown):

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

serializer: type[rest_framework.serializers.Serializer]
33    @property
34    def serializer(self) -> type[Serializer]:
35        from authentik.enterprise.providers.ws_federation.api.providers import (
36            WSFederationProviderSerializer,
37        )
38
39        return WSFederationProviderSerializer

Get serializer for this model

icon_url: str | None
41    @property
42    def icon_url(self) -> str | None:
43        return static("authentik/sources/wsfed/light.svg")
component: str
45    @property
46    def component(self) -> str:
47        return "ak-provider-wsfed-form"

Return component used to edit this object

def get_saml_version_display(unknown):

Method descriptor with partial application of the given arguments and keywords.

Supports wrapping existing descriptors and handles non-descriptor callables as instance methods.

samlprovider_ptr_id
samlprovider_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example::

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

class WSFederationProvider.DoesNotExist(authentik.providers.saml.models.SAMLProvider.DoesNotExist):

The requested object does not exist

class WSFederationProvider.MultipleObjectsReturned(authentik.providers.saml.models.SAMLProvider.MultipleObjectsReturned):

The query returned multiple objects when only one was expected.