@@ -11,6 +11,8 @@ def create(
11
11
id : Optional [str ] = None ,
12
12
self_provisioning_domains : Optional [List [str ]] = None ,
13
13
custom_attributes : Optional [dict ] = None ,
14
+ enforce_sso : Optional [bool ] = False ,
15
+ disabled : Optional [bool ] = False ,
14
16
) -> dict :
15
17
"""
16
18
Create a new tenant with the given name. Tenant IDs are provisioned automatically, but can be provided
@@ -22,6 +24,8 @@ def create(
22
24
self_provisioning_domains (List[str]): An optional list of domain that are associated with this tenant.
23
25
Users authenticating from these domains will be associated with this tenant.
24
26
custom_attributes (dict): Optional, set the different custom attributes values of the keys that were previously configured in Descope console app
27
+ enforce_sso (bool): Optional, login to the tenant is possible only using the configured sso
28
+ disabled (bool): Optional, login to the tenant will be disabled
25
29
26
30
Return value (dict):
27
31
Return dict in the format
@@ -38,7 +42,7 @@ def create(
38
42
response = self ._auth .do_post (
39
43
uri ,
40
44
Tenant ._compose_create_update_body (
41
- name , id , self_provisioning_domains , custom_attributes
45
+ name , id , self_provisioning_domains , custom_attributes , enforce_sso , disabled
42
46
),
43
47
pswd = self ._auth .management_key ,
44
48
)
@@ -50,6 +54,8 @@ def update(
50
54
name : str ,
51
55
self_provisioning_domains : Optional [List [str ]] = None ,
52
56
custom_attributes : Optional [dict ] = None ,
57
+ enforce_sso : Optional [bool ] = False ,
58
+ disabled : Optional [bool ] = False ,
53
59
):
54
60
"""
55
61
Update an existing tenant with the given name and domains. IMPORTANT: All parameters are used as overrides
@@ -61,6 +67,8 @@ def update(
61
67
self_provisioning_domains (List[str]): An optional list of domain that are associated with this tenant.
62
68
Users authenticating from these domains will be associated with this tenant.
63
69
custom_attributes (dict): Optional, set the different custom attributes values of the keys that were previously configured in Descope console app
70
+ enforce_sso (bool): Optional, login to the tenant is possible only using the configured sso
71
+ disabled (bool): Optional, login to the tenant will be disabled
64
72
65
73
Raise:
66
74
AuthException: raised if creation operation fails
@@ -73,7 +81,7 @@ def update(
73
81
self ._auth .do_post (
74
82
uri ,
75
83
Tenant ._compose_create_update_body (
76
- name , id , self_provisioning_domains , custom_attributes
84
+ name , id , self_provisioning_domains , custom_attributes , enforce_sso , disabled
77
85
),
78
86
pswd = self ._auth .management_key ,
79
87
)
@@ -184,11 +192,15 @@ def _compose_create_update_body(
184
192
id : Optional [str ],
185
193
self_provisioning_domains : List [str ],
186
194
custom_attributes : Optional [dict ] = None ,
195
+ enforce_sso : Optional [bool ] = False ,
196
+ disabled : Optional [bool ] = False ,
187
197
) -> dict :
188
198
body : dict [str , Any ] = {
189
199
"name" : name ,
190
200
"id" : id ,
191
201
"selfProvisioningDomains" : self_provisioning_domains ,
202
+ "enforceSSO" : enforce_sso ,
203
+ "disabled" : disabled
192
204
}
193
205
if custom_attributes is not None :
194
206
body ["customAttributes" ] = custom_attributes
0 commit comments