@@ -187,6 +187,7 @@ def __init__(self, appbuilder):
187
187
# Role Mapping
188
188
app .config .setdefault ("AUTH_ROLES_MAPPING" , {})
189
189
app .config .setdefault ("AUTH_ROLES_SYNC_AT_LOGIN" , False )
190
+ app .config .setdefault ("AUTH_API_LOGIN_ALLOW_MULTIPLE_PROVIDERS" , False )
190
191
191
192
# LDAP Config
192
193
if self .auth_type == AUTH_LDAP :
@@ -292,11 +293,21 @@ def get_roles_from_keys(self, role_keys: List[str]) -> Set[role_model]:
292
293
log .warning (f"Can't find role specified in AUTH_ROLES_MAPPING: { fab_role_name } " )
293
294
return _roles
294
295
296
+ @property
297
+ def auth_type_provider_name (self ):
298
+ provider_to_auth_type = {AUTH_DB : "db" , AUTH_LDAP : "ldap" }
299
+ return provider_to_auth_type .get (self .auth_type )
300
+
295
301
@property
296
302
def get_url_for_registeruser (self ):
297
303
"""Gets the URL for Register User"""
298
304
return url_for (f"{ self .registeruser_view .endpoint } .{ self .registeruser_view .default_view } " )
299
305
306
+ @property
307
+ def get_user_datamodel (self ):
308
+ """Gets the User data model"""
309
+ return self .user_view .datamodel
310
+
300
311
@property
301
312
def get_register_user_datamodel (self ):
302
313
"""Gets the Register User data model"""
@@ -307,6 +318,10 @@ def builtin_roles(self):
307
318
"""Get the builtin roles"""
308
319
return self ._builtin_roles
309
320
321
+ @property
322
+ def api_login_allow_multiple_providers (self ):
323
+ return self .appbuilder .get_app .config ["AUTH_API_LOGIN_ALLOW_MULTIPLE_PROVIDERS" ]
324
+
310
325
@property
311
326
def auth_type (self ):
312
327
"""Get the auth type"""
0 commit comments