diff options
author | Leif Johansson <leifj@sunet.se> | 2012-10-04 15:39:08 +0200 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2012-10-04 15:39:08 +0200 |
commit | 2bdad0ae7a3a6e4ec5116becd39910388b679ed2 (patch) | |
tree | 5afdfba0a93c1af50d53bdc245d57cc4053e109a /src/meetingtools/apps/auth/__init__.py | |
parent | 873e7823970352d591deee5f67f47c5436ee0e84 (diff) |
restructure
Diffstat (limited to 'src/meetingtools/apps/auth/__init__.py')
-rw-r--r-- | src/meetingtools/apps/auth/__init__.py | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/src/meetingtools/apps/auth/__init__.py b/src/meetingtools/apps/auth/__init__.py deleted file mode 100644 index e69cc29..0000000 --- a/src/meetingtools/apps/auth/__init__.py +++ /dev/null @@ -1,79 +0,0 @@ -__author__ = 'leifj' - -from django.conf import settings -from saml2.config import SPConfig -import copy -from saml2 import BINDING_HTTP_POST, BINDING_HTTP_REDIRECT - -import logging -logging.basicConfig() -logger = logging.getLogger("djangosaml2") -logger.setLevel(logging.DEBUG) - -def asgard_sp_config(request=None): - host = "localhost" - if request is not None: - host = request.get_host().replace(":","-") - x= { - # your entity id, usually your subdomain plus the url to the metadata view - 'entityid': 'https://%s/saml2/sp/metadata' % host, - # directory with attribute mapping - "attribute_map_dir" : "%s/saml2/attributemaps" % settings.BASE_DIR, - # this block states what services we provide - 'service': { - # we are just a lonely SP - 'sp' : { - 'name': 'meetingtools', - 'endpoints': { - # url and binding to the assertion consumer service view - # do not change the binding osettingsr service name - 'assertion_consumer_service': [ - ('https://%s/saml2/sp/acs/' % host, - BINDING_HTTP_POST), - ], - # url and binding to the single logout service view - # do not change the binding or service name - 'single_logout_service': [ - ('https://%s/saml2/sp/ls/' % host, - BINDING_HTTP_REDIRECT), - ], - }, - # attributes that this project need to identify a user - 'required_attributes': ['eduPersonPrincipalName','displayName','eduPersonScopedAffiliation'], - } - }, - - # where the remote metadata is stored - #'metadata': { 'remote': [{'url':'http://md.swamid.se/md/swamid-idp.xml', - # 'cert':'%s/saml2/credentials/md-signer.crt' % settings.BASE_DIR}] }, - 'metadata': {'local': [settings.SAML_METADATA_FILE]}, - - # set to 1 to output debugging information - 'debug': 1, - - # certificate - "key_file" : "%s/%s.key" % (settings.SSL_KEY_DIR,host), - "cert_file" : "%s/%s.crt" % (settings.SSL_CRT_DIR,host), - # own metadata settings - 'contact_person': [ - {'given_name': 'Leif', - 'sur_name': 'Johansson', - 'company': 'NORDUnet', - 'email_address': 'leifj@nordu.net', - 'contact_type': 'technical'}, - {'given_name': 'Johan', - 'sur_name': 'Berggren', - 'company': 'NORDUnet', - 'email_address': 'jbn@nordu.net', - 'contact_type': 'technical'}, - ], - # you can set multilanguage information here - 'organization': { - 'name': [('NORDUNet', 'en')], - 'display_name': [('NORDUnet A/S', 'en')], - 'url': [('http://www.nordu.net', 'en')], - } - } - c = SPConfig() - c.load(copy.deepcopy(x)) - return c |