{"action":"created","issue":{"url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/651","repository_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp","labels_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/651/labels{/name}","comments_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/651/comments","events_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/651/events","html_url":"https://github.com/simplesamlphp/simplesamlphp/issues/651","id":242314180,"number":651,"title":"getSelfURL() function returns URL with port number","user":{"login":"karolflis","id":19688218,"avatar_url":"https://avatars2.githubusercontent.com/u/19688218?v=3","gravatar_id":"","url":"https://api.github.com/users/karolflis","html_url":"https://github.com/karolflis","followers_url":"https://api.github.com/users/karolflis/followers","following_url":"https://api.github.com/users/karolflis/following{/other_user}","gists_url":"https://api.github.com/users/karolflis/gists{/gist_id}","starred_url":"https://api.github.com/users/karolflis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karolflis/subscriptions","organizations_url":"https://api.github.com/users/karolflis/orgs","repos_url":"https://api.github.com/users/karolflis/repos","events_url":"https://api.github.com/users/karolflis/events{/privacy}","received_events_url":"https://api.github.com/users/karolflis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-12T09:24:12Z","updated_at":"2017-07-12T09:36:05Z","closed_at":"2017-07-12T09:36:05Z","body":"Hello guys.\r\n\r\nCould you review it and decide if this is something that can be changed?\r\n\r\nNot sure if this can be treated as bug, but it caused an issue in SAML implementation for Moodle plugin auth_saml2 which includes simplesamlphp as external library.\r\n\r\nURL returned by this function (with port number appended to it) couldn't be matched to FQDN causing unexpected error. I have hotfixed it, in my use case and it did the job.\r\n\r\nUnfortunately I don't have knowledge if this function is used anywhere else and requires this port number appended.\r\n\r\nThis is in file:\r\nlib/simplesamlphp/lib/SimpleSAML/Utils/HTTP.php\r\n\r\n`771: return $protocol.$hostname.$port.$_SERVER['REQUEST_URI'];`\r\n\r\nURL generated by this code contains port number appended to it.\r\nI have encountered a case where this URL is compared against application URL and mismatched because of port value appended to domain name.\r\n\r\nEnded up in error about mismatched URLs:\r\n\r\nDestination in response doesn't match the current URL.\r\nDestination is \"https://example.domain.com/auth/saml2/sp/saml2-acs.php/foobar\", current URL is\r\n\"https://example.domain.com:443/auth/saml2/sp/saml2-acs.php/foobar\".\r\n"},"comment":{"url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/comments/314709643","html_url":"https://github.com/simplesamlphp/simplesamlphp/issues/651#issuecomment-314709643","issue_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/651","id":314709643,"user":{"login":"jaimeperez","id":1942728,"avatar_url":"https://avatars3.githubusercontent.com/u/1942728?v=3","gravatar_id":"","url":"https://api.github.com/users/jaimeperez","html_url":"https://github.com/jaimeperez","followers_url":"https://api.github.com/users/jaimeperez/followers","following_url":"https://api.github.com/users/jaimeperez/following{/other_user}","gists_url":"https://api.github.com/users/jaimeperez/gists{/gist_id}","starred_url":"https://api.github.com/users/jaimeperez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaimeperez/subscriptions","organizations_url":"https://api.github.com/users/jaimeperez/orgs","repos_url":"https://api.github.com/users/jaimeperez/repos","events_url":"https://api.github.com/users/jaimeperez/events{/privacy}","received_events_url":"https://api.github.com/users/jaimeperez/received_events","type":"User","site_admin":false},"created_at":"2017-07-12T09:36:05Z","updated_at":"2017-07-12T09:36:05Z","body":"Hi @karolflis!\r\n\r\nThe function is fine. That code is only triggered when something goes seriously wrong or when the code is reached from a URL that doesn't belong to SimpleSAMLphp.\r\n\r\nSet the `baseurlpath` configuration option to your canonical URL and the problem will be gone."}}
{"actor":{"display_login":"jaimeperez"}}