Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server_port can be None #77

Closed
ganehag opened this issue Jul 22, 2015 · 1 comment
Closed

server_port can be None #77

ganehag opened this issue Jul 22, 2015 · 1 comment

Comments

@ganehag
Copy link

ganehag commented Jul 22, 2015

In demo-flask the function prepare_flask_request returns a dict containing server_port. The urlparse function will return None for the key port when it is not defined in the parsed URL. Thus server_port will also be None.

In onelogin/saml2/utils.py the method get_self_url_host checks for the existence of server_port and appends it to the URL to be returnd from get_self_url_host. But it only checks if the key is in request_data.

Line 264 of utils.py should change from:

if 'server_port' in request_data:

to

if 'server_port' in request_data and request_data['server_port'] is not None:

The way the code works today is to cast server_port to str even if it is None.

This is probably related to issue #48.

"The response was received at http://XXX.XXX.XXX: None instead of http://XXX.XXX.XXX" error and resulted in "Not authenticated"

Because https://example.com:None/?acs is the URL returned from get_self_url_host.

pitbulk added a commit that referenced this issue Jul 28, 2015
@pitbulk
Copy link
Contributor

pitbulk commented Jul 28, 2015

Fixed.

@pitbulk pitbulk closed this as completed Jul 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants