We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5fa6b1a commit 480fb88Copy full SHA for 480fb88
1 file changed
djangosaml2/utils.py
@@ -13,6 +13,7 @@
13
# limitations under the License.
14
15
from django.conf import settings
16
+from django.core.exceptions import ImproperlyConfigured
17
from saml2.s_utils import UnknownSystemEntity
18
19
@@ -46,7 +47,10 @@ def get_idp_sso_supported_bindings(idp_entity_id=None, config=None):
46
47
# if idp is None, assume only one exists so just use that
48
if idp_entity_id is None:
49
# .keys() returns dict_keys in python3.5+
- idp_entity_id = list(available_idps(config).keys()).pop()
50
+ try:
51
+ idp_entity_id = list(available_idps(config).keys())[0]
52
+ except IndexError:
53
+ raise ImproperlyConfigured("No IdP configured!")
54
try:
55
return meta.service(idp_entity_id, 'idpsso_descriptor', 'single_sign_on_service').keys()
56
except UnknownSystemEntity:
0 commit comments