blob: 01f7561e1fa9eb73b040f0797d33764323bac68d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
__author__ = 'leifj'
from django.conf import settings
from django.utils.importlib import import_module
_token_provider_modules = list()
def autodiscover():
for app in settings.INSTALLED_APPS:
mod = import_module(app)
if hasattr(mod,'token_providers' and hasattr(mod.token_providers,'__call__')):
_token_provider_modules.append(mod)
def providers():
p = list()
for mod in _token_provider_modules:
p.extend(mod.token_providers())
return p
autodiscover()
# self.authorization_uri
# self.logo
# self.name
# self.description
# self.service_uri
|