authentik.enterprise.providers.microsoft_entra.models
Microsoft Entra sync provider
1"""Microsoft Entra sync provider""" 2 3from typing import Any, Self 4from uuid import uuid4 5 6from django.db import models 7from django.templatetags.static import static 8from django.utils.translation import gettext_lazy as _ 9from dramatiq.actor import Actor 10from rest_framework.serializers import Serializer 11 12from authentik.core.models import ( 13 BackchannelProvider, 14 Group, 15 PropertyMapping, 16 User, 17) 18from authentik.lib.models import InternallyManagedMixin, SerializerModel, SimpleThroughModel 19from authentik.lib.sync.outgoing.base import BaseOutgoingSyncClient 20from authentik.lib.sync.outgoing.models import ( 21 OutgoingSyncDeleteAction, 22 OutgoingSyncObjectQueryMixin, 23 OutgoingSyncProvider, 24) 25 26 27class MicrosoftEntraProviderUser(InternallyManagedMixin, SerializerModel): 28 """Mapping of a user and provider to a Microsoft user ID""" 29 30 id = models.UUIDField(primary_key=True, editable=False, default=uuid4) 31 microsoft_id = models.TextField() 32 user = models.ForeignKey(User, on_delete=models.CASCADE) 33 provider = models.ForeignKey("MicrosoftEntraProvider", on_delete=models.CASCADE) 34 attributes = models.JSONField(default=dict) 35 36 @property 37 def serializer(self) -> type[Serializer]: 38 from authentik.enterprise.providers.microsoft_entra.api.users import ( 39 MicrosoftEntraProviderUserSerializer, 40 ) 41 42 return MicrosoftEntraProviderUserSerializer 43 44 class Meta: 45 verbose_name = _("Microsoft Entra Provider User") 46 verbose_name_plural = _("Microsoft Entra Provider User") 47 unique_together = (("microsoft_id", "user", "provider"),) 48 49 def __str__(self) -> str: 50 return f"Microsoft Entra Provider User {self.user_id} to {self.provider_id}" 51 52 53class MicrosoftEntraProviderGroup(InternallyManagedMixin, SerializerModel): 54 """Mapping of a group and provider to a Microsoft group ID""" 55 56 id = models.UUIDField(primary_key=True, editable=False, default=uuid4) 57 microsoft_id = models.TextField() 58 group = models.ForeignKey(Group, on_delete=models.CASCADE) 59 provider = models.ForeignKey("MicrosoftEntraProvider", on_delete=models.CASCADE) 60 attributes = models.JSONField(default=dict) 61 62 @property 63 def serializer(self) -> type[Serializer]: 64 from authentik.enterprise.providers.microsoft_entra.api.groups import ( 65 MicrosoftEntraProviderGroupSerializer, 66 ) 67 68 return MicrosoftEntraProviderGroupSerializer 69 70 class Meta: 71 verbose_name = _("Microsoft Entra Provider Group") 72 verbose_name_plural = _("Microsoft Entra Provider Groups") 73 unique_together = (("microsoft_id", "group", "provider"),) 74 75 def __str__(self) -> str: 76 return f"Microsoft Entra Provider Group {self.group_id} to {self.provider_id}" 77 78 79class MicrosoftEntraProvider( 80 OutgoingSyncObjectQueryMixin, OutgoingSyncProvider, BackchannelProvider 81): 82 """Sync users from authentik into Microsoft Entra.""" 83 84 client_id = models.TextField() 85 client_secret = models.TextField() 86 tenant_id = models.TextField() 87 88 exclude_users_service_account = models.BooleanField(default=False) 89 user_delete_action = models.TextField( 90 choices=OutgoingSyncDeleteAction.choices, default=OutgoingSyncDeleteAction.DELETE 91 ) 92 group_delete_action = models.TextField( 93 choices=OutgoingSyncDeleteAction.choices, default=OutgoingSyncDeleteAction.DELETE 94 ) 95 group_filters = models.ManyToManyField( 96 "authentik_core.group", 97 default=None, 98 blank=True, 99 help_text=_("Group filters used to define sync-scope for groups."), 100 related_name="+", 101 through="MicrosoftEntraProviderGroupFilter", 102 ) 103 104 # Keep the legacy field for rolling upgrades and group deletion. 105 filter_group = models.ForeignKey( 106 "authentik_core.group", on_delete=models.SET_DEFAULT, default=None, null=True 107 ) 108 109 property_mappings_group = models.ManyToManyField( 110 PropertyMapping, 111 default=None, 112 blank=True, 113 help_text=_("Property mappings used for group creation/updating."), 114 through="MicrosoftEntraProviderPropertyMappingsGroup", 115 ) 116 117 @property 118 def sync_actor(self) -> Actor: 119 from authentik.enterprise.providers.microsoft_entra.tasks import microsoft_entra_sync 120 121 return microsoft_entra_sync 122 123 def client_for_model( 124 self, 125 model: type[User | Group | MicrosoftEntraProviderUser | MicrosoftEntraProviderGroup], 126 ) -> BaseOutgoingSyncClient[User | Group, Any, Any, Self]: 127 if issubclass(model, User | MicrosoftEntraProviderUser): 128 from authentik.enterprise.providers.microsoft_entra.clients.users import ( 129 MicrosoftEntraUserClient, 130 ) 131 132 return MicrosoftEntraUserClient(self) 133 if issubclass(model, Group | MicrosoftEntraProviderGroup): 134 from authentik.enterprise.providers.microsoft_entra.clients.groups import ( 135 MicrosoftEntraGroupClient, 136 ) 137 138 return MicrosoftEntraGroupClient(self) 139 raise ValueError(f"Invalid model {model}") 140 141 @classmethod 142 def get_object_mappings(cls, obj: User | Group) -> list[tuple[str, str]]: 143 if isinstance(obj, User): 144 return list( 145 obj.microsoftentraprovideruser_set.values_list("provider__pk", "microsoft_id") 146 ) 147 if isinstance(obj, Group): 148 return list( 149 obj.microsoftentraprovidergroup_set.values_list("provider__pk", "microsoft_id") 150 ) 151 raise ValueError(f"Invalid type {type(obj)}") 152 153 def microsoft_credentials(self): 154 from azure.identity.aio import ClientSecretCredential 155 156 return { 157 "credentials": ClientSecretCredential( 158 self.tenant_id, self.client_id, self.client_secret 159 ) 160 } 161 162 @property 163 def icon_url(self) -> str | None: 164 return static("authentik/sources/azuread/light.svg") 165 166 @property 167 def component(self) -> str: 168 return "ak-provider-microsoft-entra-form" 169 170 @property 171 def serializer(self) -> type[Serializer]: 172 from authentik.enterprise.providers.microsoft_entra.api.providers import ( 173 MicrosoftEntraProviderSerializer, 174 ) 175 176 return MicrosoftEntraProviderSerializer 177 178 def __str__(self): 179 return f"Microsoft Entra Provider {self.name}" 180 181 class Meta: 182 verbose_name = _("Microsoft Entra Provider") 183 verbose_name_plural = _("Microsoft Entra Providers") 184 185 186class MicrosoftEntraProviderGroupFilter(SimpleThroughModel): 187 group = models.ForeignKey(Group, on_delete=models.CASCADE) 188 microsoft_entra_provider = models.ForeignKey( 189 MicrosoftEntraProvider, 190 on_delete=models.CASCADE, 191 db_column="microsoftentraprovider_id", 192 ) 193 194 class Meta: 195 db_table = "authentik_providers_microsoft_entra_group_filters" 196 unique_together = (("group", "microsoft_entra_provider"),) 197 verbose_name = _("Microsoft Entra Provider Group Filter") 198 verbose_name_plural = _("Microsoft Entra Provider Group Filters") 199 200 def __str__(self): 201 return ( 202 f"MicrosoftEntraProviderGroupFilter for MicrosoftEntraProvider " 203 f"{self.microsoft_entra_provider_id} and Group {self.group_id}." 204 ) 205 206 207class MicrosoftEntraProviderPropertyMappingsGroup(SimpleThroughModel): 208 microsoft_entra_provider = models.ForeignKey( 209 MicrosoftEntraProvider, 210 on_delete=models.CASCADE, 211 db_column="microsoftentraprovider_id", 212 ) 213 property_mapping = models.ForeignKey( 214 PropertyMapping, on_delete=models.CASCADE, db_column="propertymapping_id" 215 ) 216 217 class Meta: 218 db_table = "authentik_providers_microsoft_entra_microsoftentraprovider_9f0b" 219 unique_together = (("microsoft_entra_provider", "property_mapping"),) 220 verbose_name = _("Microsoft Entra Provider Property Mappings Group") 221 verbose_name_plural = _("Microsoft Entra Provider Property Mappings Groups") 222 223 def __str__(self): 224 return ( 225 "MicrosoftEntraProviderPropertyMappingsGroup for MicrosoftEntraProvider " 226 f"{self.microsoft_entra_provider_id} " 227 f"and PropertyMapping {self.property_mapping_id}." 228 ) 229 230 231class MicrosoftEntraProviderMapping(PropertyMapping): 232 """Map authentik data to outgoing Microsoft requests""" 233 234 expression_allowed_types = [dict] 235 236 @property 237 def component(self) -> str: 238 return "ak-property-mapping-provider-microsoft-entra-form" 239 240 @property 241 def serializer(self) -> type[Serializer]: 242 from authentik.enterprise.providers.microsoft_entra.api.property_mappings import ( 243 MicrosoftEntraProviderMappingSerializer, 244 ) 245 246 return MicrosoftEntraProviderMappingSerializer 247 248 def __str__(self): 249 return f"Microsoft Entra Provider Mapping {self.name}" 250 251 class Meta: 252 verbose_name = _("Microsoft Entra Provider Mapping") 253 verbose_name_plural = _("Microsoft Entra Provider Mappings")
28class MicrosoftEntraProviderUser(InternallyManagedMixin, SerializerModel): 29 """Mapping of a user and provider to a Microsoft user ID""" 30 31 id = models.UUIDField(primary_key=True, editable=False, default=uuid4) 32 microsoft_id = models.TextField() 33 user = models.ForeignKey(User, on_delete=models.CASCADE) 34 provider = models.ForeignKey("MicrosoftEntraProvider", on_delete=models.CASCADE) 35 attributes = models.JSONField(default=dict) 36 37 @property 38 def serializer(self) -> type[Serializer]: 39 from authentik.enterprise.providers.microsoft_entra.api.users import ( 40 MicrosoftEntraProviderUserSerializer, 41 ) 42 43 return MicrosoftEntraProviderUserSerializer 44 45 class Meta: 46 verbose_name = _("Microsoft Entra Provider User") 47 verbose_name_plural = _("Microsoft Entra Provider User") 48 unique_together = (("microsoft_id", "user", "provider"),) 49 50 def __str__(self) -> str: 51 return f"Microsoft Entra Provider User {self.user_id} to {self.provider_id}"
Mapping of a user and provider to a Microsoft user ID
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Child.parent is a ForwardManyToOneDescriptor instance.
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Child.parent is a ForwardManyToOneDescriptor instance.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
37 @property 38 def serializer(self) -> type[Serializer]: 39 from authentik.enterprise.providers.microsoft_entra.api.users import ( 40 MicrosoftEntraProviderUserSerializer, 41 ) 42 43 return MicrosoftEntraProviderUserSerializer
Get serializer for this model
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.
54class MicrosoftEntraProviderGroup(InternallyManagedMixin, SerializerModel): 55 """Mapping of a group and provider to a Microsoft group ID""" 56 57 id = models.UUIDField(primary_key=True, editable=False, default=uuid4) 58 microsoft_id = models.TextField() 59 group = models.ForeignKey(Group, on_delete=models.CASCADE) 60 provider = models.ForeignKey("MicrosoftEntraProvider", on_delete=models.CASCADE) 61 attributes = models.JSONField(default=dict) 62 63 @property 64 def serializer(self) -> type[Serializer]: 65 from authentik.enterprise.providers.microsoft_entra.api.groups import ( 66 MicrosoftEntraProviderGroupSerializer, 67 ) 68 69 return MicrosoftEntraProviderGroupSerializer 70 71 class Meta: 72 verbose_name = _("Microsoft Entra Provider Group") 73 verbose_name_plural = _("Microsoft Entra Provider Groups") 74 unique_together = (("microsoft_id", "group", "provider"),) 75 76 def __str__(self) -> str: 77 return f"Microsoft Entra Provider Group {self.group_id} to {self.provider_id}"
Mapping of a group and provider to a Microsoft group ID
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Child.parent is a ForwardManyToOneDescriptor instance.
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Child.parent is a ForwardManyToOneDescriptor instance.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
63 @property 64 def serializer(self) -> type[Serializer]: 65 from authentik.enterprise.providers.microsoft_entra.api.groups import ( 66 MicrosoftEntraProviderGroupSerializer, 67 ) 68 69 return MicrosoftEntraProviderGroupSerializer
Get serializer for this model
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.
80class MicrosoftEntraProvider( 81 OutgoingSyncObjectQueryMixin, OutgoingSyncProvider, BackchannelProvider 82): 83 """Sync users from authentik into Microsoft Entra.""" 84 85 client_id = models.TextField() 86 client_secret = models.TextField() 87 tenant_id = models.TextField() 88 89 exclude_users_service_account = models.BooleanField(default=False) 90 user_delete_action = models.TextField( 91 choices=OutgoingSyncDeleteAction.choices, default=OutgoingSyncDeleteAction.DELETE 92 ) 93 group_delete_action = models.TextField( 94 choices=OutgoingSyncDeleteAction.choices, default=OutgoingSyncDeleteAction.DELETE 95 ) 96 group_filters = models.ManyToManyField( 97 "authentik_core.group", 98 default=None, 99 blank=True, 100 help_text=_("Group filters used to define sync-scope for groups."), 101 related_name="+", 102 through="MicrosoftEntraProviderGroupFilter", 103 ) 104 105 # Keep the legacy field for rolling upgrades and group deletion. 106 filter_group = models.ForeignKey( 107 "authentik_core.group", on_delete=models.SET_DEFAULT, default=None, null=True 108 ) 109 110 property_mappings_group = models.ManyToManyField( 111 PropertyMapping, 112 default=None, 113 blank=True, 114 help_text=_("Property mappings used for group creation/updating."), 115 through="MicrosoftEntraProviderPropertyMappingsGroup", 116 ) 117 118 @property 119 def sync_actor(self) -> Actor: 120 from authentik.enterprise.providers.microsoft_entra.tasks import microsoft_entra_sync 121 122 return microsoft_entra_sync 123 124 def client_for_model( 125 self, 126 model: type[User | Group | MicrosoftEntraProviderUser | MicrosoftEntraProviderGroup], 127 ) -> BaseOutgoingSyncClient[User | Group, Any, Any, Self]: 128 if issubclass(model, User | MicrosoftEntraProviderUser): 129 from authentik.enterprise.providers.microsoft_entra.clients.users import ( 130 MicrosoftEntraUserClient, 131 ) 132 133 return MicrosoftEntraUserClient(self) 134 if issubclass(model, Group | MicrosoftEntraProviderGroup): 135 from authentik.enterprise.providers.microsoft_entra.clients.groups import ( 136 MicrosoftEntraGroupClient, 137 ) 138 139 return MicrosoftEntraGroupClient(self) 140 raise ValueError(f"Invalid model {model}") 141 142 @classmethod 143 def get_object_mappings(cls, obj: User | Group) -> list[tuple[str, str]]: 144 if isinstance(obj, User): 145 return list( 146 obj.microsoftentraprovideruser_set.values_list("provider__pk", "microsoft_id") 147 ) 148 if isinstance(obj, Group): 149 return list( 150 obj.microsoftentraprovidergroup_set.values_list("provider__pk", "microsoft_id") 151 ) 152 raise ValueError(f"Invalid type {type(obj)}") 153 154 def microsoft_credentials(self): 155 from azure.identity.aio import ClientSecretCredential 156 157 return { 158 "credentials": ClientSecretCredential( 159 self.tenant_id, self.client_id, self.client_secret 160 ) 161 } 162 163 @property 164 def icon_url(self) -> str | None: 165 return static("authentik/sources/azuread/light.svg") 166 167 @property 168 def component(self) -> str: 169 return "ak-provider-microsoft-entra-form" 170 171 @property 172 def serializer(self) -> type[Serializer]: 173 from authentik.enterprise.providers.microsoft_entra.api.providers import ( 174 MicrosoftEntraProviderSerializer, 175 ) 176 177 return MicrosoftEntraProviderSerializer 178 179 def __str__(self): 180 return f"Microsoft Entra Provider {self.name}" 181 182 class Meta: 183 verbose_name = _("Microsoft Entra Provider") 184 verbose_name_plural = _("Microsoft Entra Providers")
Sync users from authentik into Microsoft Entra.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example::
class Pizza(Model):
toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings and Topping.pizzas are ManyToManyDescriptor
instances.
Most of the implementation is delegated to a dynamically defined manager
class built by create_forward_many_to_many_manager() defined below.
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Child.parent is a ForwardManyToOneDescriptor instance.
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example::
class Pizza(Model):
toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings and Topping.pizzas are ManyToManyDescriptor
instances.
Most of the implementation is delegated to a dynamically defined manager
class built by create_forward_many_to_many_manager() defined below.
124 def client_for_model( 125 self, 126 model: type[User | Group | MicrosoftEntraProviderUser | MicrosoftEntraProviderGroup], 127 ) -> BaseOutgoingSyncClient[User | Group, Any, Any, Self]: 128 if issubclass(model, User | MicrosoftEntraProviderUser): 129 from authentik.enterprise.providers.microsoft_entra.clients.users import ( 130 MicrosoftEntraUserClient, 131 ) 132 133 return MicrosoftEntraUserClient(self) 134 if issubclass(model, Group | MicrosoftEntraProviderGroup): 135 from authentik.enterprise.providers.microsoft_entra.clients.groups import ( 136 MicrosoftEntraGroupClient, 137 ) 138 139 return MicrosoftEntraGroupClient(self) 140 raise ValueError(f"Invalid model {model}")
142 @classmethod 143 def get_object_mappings(cls, obj: User | Group) -> list[tuple[str, str]]: 144 if isinstance(obj, User): 145 return list( 146 obj.microsoftentraprovideruser_set.values_list("provider__pk", "microsoft_id") 147 ) 148 if isinstance(obj, Group): 149 return list( 150 obj.microsoftentraprovidergroup_set.values_list("provider__pk", "microsoft_id") 151 ) 152 raise ValueError(f"Invalid type {type(obj)}")
Get a list of mapping between User/Group and ProviderUser/Group: [("provider_pk", "obj_pk")]
171 @property 172 def serializer(self) -> type[Serializer]: 173 from authentik.enterprise.providers.microsoft_entra.api.providers import ( 174 MicrosoftEntraProviderSerializer, 175 ) 176 177 return MicrosoftEntraProviderSerializer
Get serializer for this model
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Accessor to the related objects manager on the one-to-many relation created by GenericRelation.
In the example::
class Post(Model):
comments = GenericRelation(Comment)
post.comments is a ReverseGenericManyToOneDescriptor instance.
Accessor to the related objects manager on the one-to-many relation created by GenericRelation.
In the example::
class Post(Model):
comments = GenericRelation(Comment)
post.comments is a ReverseGenericManyToOneDescriptor instance.
Method descriptor with partial application of the given arguments and keywords.
Supports wrapping existing descriptors and handles non-descriptor callables as instance methods.
Method descriptor with partial application of the given arguments and keywords.
Supports wrapping existing descriptors and handles non-descriptor callables as instance methods.
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.
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Parent.children is a ReverseManyToOneDescriptor instance.
Most of the implementation is delegated to a dynamically defined manager
class built by create_forward_many_to_many_manager() defined below.
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Parent.children is a ReverseManyToOneDescriptor instance.
Most of the implementation is delegated to a dynamically defined manager
class built by create_forward_many_to_many_manager() defined below.
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Parent.children is a ReverseManyToOneDescriptor instance.
Most of the implementation is delegated to a dynamically defined manager
class built by create_forward_many_to_many_manager() defined below.
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Parent.children is a ReverseManyToOneDescriptor instance.
Most of the implementation is delegated to a dynamically defined manager
class built by create_forward_many_to_many_manager() defined below.
Inherited Members
- authentik.lib.sync.outgoing.models.OutgoingSyncProvider
- Meta
- get_paginator
- get_object_sync_time_limit_ms
- get_sync_time_limit_ms
- sync_lock
- sync_dispatch
- schedule_specs
- authentik.lib.sync.outgoing.models.OutgoingSyncObjectQueryMixin
- backchannel_application
- get_object_qs
- authentik.core.models.Provider
- name
- authentication_flow
- invalidation_flow
- property_mappings
- is_backchannel
- objects
- launch_url
- authentication_flow_id
- invalidation_flow_id
- backchannel_application_id
- id
- application
- providerpropertymapping_set
- outpost_set
- outpostprovider_set
- oauth2provider
- ldapprovider
- racprovider
- radiusprovider
- samlprovider
- scimprovider
- googleworkspaceprovider
- microsoftentraprovider
- ssfprovider
The requested object does not exist
The query returned multiple objects when only one was expected.
187class MicrosoftEntraProviderGroupFilter(SimpleThroughModel): 188 group = models.ForeignKey(Group, on_delete=models.CASCADE) 189 microsoft_entra_provider = models.ForeignKey( 190 MicrosoftEntraProvider, 191 on_delete=models.CASCADE, 192 db_column="microsoftentraprovider_id", 193 ) 194 195 class Meta: 196 db_table = "authentik_providers_microsoft_entra_group_filters" 197 unique_together = (("group", "microsoft_entra_provider"),) 198 verbose_name = _("Microsoft Entra Provider Group Filter") 199 verbose_name_plural = _("Microsoft Entra Provider Group Filters") 200 201 def __str__(self): 202 return ( 203 f"MicrosoftEntraProviderGroupFilter for MicrosoftEntraProvider " 204 f"{self.microsoft_entra_provider_id} and Group {self.group_id}." 205 )
MicrosoftEntraProviderGroupFilter(id, group, microsoft_entra_provider)
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Child.parent is a ForwardManyToOneDescriptor instance.
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Child.parent is a ForwardManyToOneDescriptor instance.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.
208class MicrosoftEntraProviderPropertyMappingsGroup(SimpleThroughModel): 209 microsoft_entra_provider = models.ForeignKey( 210 MicrosoftEntraProvider, 211 on_delete=models.CASCADE, 212 db_column="microsoftentraprovider_id", 213 ) 214 property_mapping = models.ForeignKey( 215 PropertyMapping, on_delete=models.CASCADE, db_column="propertymapping_id" 216 ) 217 218 class Meta: 219 db_table = "authentik_providers_microsoft_entra_microsoftentraprovider_9f0b" 220 unique_together = (("microsoft_entra_provider", "property_mapping"),) 221 verbose_name = _("Microsoft Entra Provider Property Mappings Group") 222 verbose_name_plural = _("Microsoft Entra Provider Property Mappings Groups") 223 224 def __str__(self): 225 return ( 226 "MicrosoftEntraProviderPropertyMappingsGroup for MicrosoftEntraProvider " 227 f"{self.microsoft_entra_provider_id} " 228 f"and PropertyMapping {self.property_mapping_id}." 229 )
MicrosoftEntraProviderPropertyMappingsGroup(id, microsoft_entra_provider, property_mapping)
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Child.parent is a ForwardManyToOneDescriptor instance.
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Child.parent is a ForwardManyToOneDescriptor instance.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.
232class MicrosoftEntraProviderMapping(PropertyMapping): 233 """Map authentik data to outgoing Microsoft requests""" 234 235 expression_allowed_types = [dict] 236 237 @property 238 def component(self) -> str: 239 return "ak-property-mapping-provider-microsoft-entra-form" 240 241 @property 242 def serializer(self) -> type[Serializer]: 243 from authentik.enterprise.providers.microsoft_entra.api.property_mappings import ( 244 MicrosoftEntraProviderMappingSerializer, 245 ) 246 247 return MicrosoftEntraProviderMappingSerializer 248 249 def __str__(self): 250 return f"Microsoft Entra Provider Mapping {self.name}" 251 252 class Meta: 253 verbose_name = _("Microsoft Entra Provider Mapping") 254 verbose_name_plural = _("Microsoft Entra Provider Mappings")
Map authentik data to outgoing Microsoft requests
237 @property 238 def component(self) -> str: 239 return "ak-property-mapping-provider-microsoft-entra-form"
Return component used to edit this object
241 @property 242 def serializer(self) -> type[Serializer]: 243 from authentik.enterprise.providers.microsoft_entra.api.property_mappings import ( 244 MicrosoftEntraProviderMappingSerializer, 245 ) 246 247 return MicrosoftEntraProviderMappingSerializer
Get serializer for this model
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.
Inherited Members
- authentik.core.models.PropertyMapping
- pm_uuid
- name
- expression
- objects
- evaluate
- managed
- provider_set
- source_userpropertymappings_set
- source_grouppropertymappings_set
- sourceuserpropertymapping_set
- sourcegrouppropertymapping_set
- providerpropertymapping_set
- notificationwebhookmapping
- kerberossourcepropertymapping
- ldapsourcepropertymapping
- oauthsourcepropertymapping
- scopemapping
- racpropertymapping
- radiusproviderpropertymapping
- samlsourcepropertymapping
- samlpropertymapping
- scimprovider_set
- scimprovidergrouppropertymapping_set
- scimmapping
- plexsourcepropertymapping
- scimsourcepropertymapping
- telegramsourcepropertymapping
- googleworkspaceprovider_set
- googleworkspaceproviderpropertymappingsgroup_set
- googleworkspaceprovidermapping
- microsoftentraprovider_set
- microsoftentraproviderpropertymappingsgroup_set
- microsoftentraprovidermapping
The requested object does not exist
The query returned multiple objects when only one was expected.