Merge "make user_info_endpoint_url independent of auth_url"

This commit is contained in:
Zuul 2018-10-21 14:23:24 +00:00 committed by Gerrit Code Review
commit 4af5e09234

View File

@ -106,8 +106,11 @@ class KeycloakAuth(base.ConfigurableMiddleware):
self._unauthorized(message)
def call_keycloak(self):
endpoint = ('%s' + self.user_info_endpoint_url) % (self.auth_url,
self.realm_name)
if self.user_info_endpoint_url.startswith(('http://', 'https://')):
endpoint = self.user_info_endpoint_url
else:
endpoint = ('%s' + self.user_info_endpoint_url) % \
(self.auth_url, self.realm_name)
headers = {'Authorization': 'Bearer %s' % self.token}
verify = None
if urllib.parse.urlparse(endpoint).scheme == "https":