summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2012-04-03 11:23:44 +0200
committerLeif Johansson <leifj@sunet.se>2012-04-03 11:23:44 +0200
commit03bcc96c54a277d1d791303e411a72fed8318439 (patch)
tree86afb0c65c65564f1e31e119327720310a11ca5b
parent0521b2537d1f02454989a3eb7f84e3fd05ea5016 (diff)
full path alt
-rw-r--r--coip/apps/saml2/views.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/coip/apps/saml2/views.py b/coip/apps/saml2/views.py
index c6c9846..2fcde4f 100644
--- a/coip/apps/saml2/views.py
+++ b/coip/apps/saml2/views.py
@@ -14,16 +14,22 @@ from saml2.metadata import entity_descriptor
from saml2.saml import NAME_FORMAT_URI
from django.conf import settings
+def get_full_path(request,path=None):
+ if path == None:
+ path = request.path
+ full_path = ('http', ('', 's')[request.is_secure()], '://', request.META['HTTP_HOST'], path)
+ return ''.join(full_path)
+
def _config(request):
host = request.get_host().replace(":","-")
c = {
- "entityid" : request.build_absolute_uri("/saml2/entity"),
+ "entityid" : get_full_path(request,"/saml2/entity"),
"description": "COIP",
"service": {
"aa": {
"name" : "COIP",
"endpoints" : {
- "attribute_service" : [(request.build_absolute_uri("/saml2/aq"), BINDING_SOAP)],
+ "attribute_service" : [(get_full_path(request,"/saml2/aq"), BINDING_SOAP)],
},
"policy": {
"default": {
@@ -45,7 +51,7 @@ def _config(request):
"organization": {
"display_name": "COIP on %s" % host,
"name": "COIP on %s" % host,
- "url": request.build_absolute_uri("/"),
+ "url": get_full_path(request,"/"),
},
}
return c