Commit a0ab47a4 authored by Valentin Samir's avatar Valentin Samir

Allow pgtUrl to be localhost without https

parent b96c0ef4
...@@ -23,6 +23,7 @@ from django.views.decorators.csrf import csrf_exempt ...@@ -23,6 +23,7 @@ from django.views.decorators.csrf import csrf_exempt
from django.views.generic import View from django.views.generic import View
import re
import logging import logging
import pprint import pprint
import requests import requests
...@@ -666,7 +667,10 @@ class ValidateService(View, AttributesMixin): ...@@ -666,7 +667,10 @@ class ValidateService(View, AttributesMixin):
params['username'] = self.ticket.user.attributs.get( params['username'] = self.ticket.user.attributs.get(
self.ticket.service_pattern.user_field self.ticket.service_pattern.user_field
) )
if self.pgt_url and self.pgt_url.startswith("https://"): if self.pgt_url and (
self.pgt_url.startswith("https://") or
re.match("^http://(127\.0\.0\.1|localhost)(:[0-9]+)?(/.*)?$", self.pgt_url)
):
return self.process_pgturl(params) return self.process_pgturl(params)
else: else:
logger.info( logger.info(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment