{"action":"created","issue":{"url":"https://api.github.com/repos/SpoonX/aurelia-authentication/issues/248","repository_url":"https://api.github.com/repos/SpoonX/aurelia-authentication","labels_url":"https://api.github.com/repos/SpoonX/aurelia-authentication/issues/248/labels{/name}","comments_url":"https://api.github.com/repos/SpoonX/aurelia-authentication/issues/248/comments","events_url":"https://api.github.com/repos/SpoonX/aurelia-authentication/issues/248/events","html_url":"https://github.com/SpoonX/aurelia-authentication/issues/248","id":175899667,"number":248,"title":"Configurable location for Popup window closing (Web platform)","user":{"login":"genadis","id":6747147,"avatar_url":"https://avatars.githubusercontent.com/u/6747147?v=3","gravatar_id":"","url":"https://api.github.com/users/genadis","html_url":"https://github.com/genadis","followers_url":"https://api.github.com/users/genadis/followers","following_url":"https://api.github.com/users/genadis/following{/other_user}","gists_url":"https://api.github.com/users/genadis/gists{/gist_id}","starred_url":"https://api.github.com/users/genadis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/genadis/subscriptions","organizations_url":"https://api.github.com/users/genadis/orgs","repos_url":"https://api.github.com/users/genadis/repos","events_url":"https://api.github.com/users/genadis/events{/privacy}","received_events_url":"https://api.github.com/users/genadis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-09-09T00:41:32Z","updated_at":"2016-09-10T22:23:05Z","closed_at":null,"body":"In my use case aurelia-authentication plugin is part of application that is a widget running on different websites (domains).\r\nFor example the widget can run on website: `foo.com`, while the widget authentication and operation is performed against server running on `widget.com/api`.\r\n\r\nFrom what I can tell, the [popup](https://github.com/SpoonX/aurelia-authentication/blob/master/src/popup.js) windows is waiting for redirect to the hosting website:\r\n`PLATFORM.global.document.location.host` to close the popup window and continue to the Post step.\r\n\r\nThat requires that the redirectUri is always of the website the call originated from.\r\nIn my case the redirectUri is to different domain (to the domain of my server providing the widget service).\r\n\r\nIt would be great if there was a configuration option that would allow to specify comparing to redirectUri instead of:\r\n```\r\nif (this.popupWindow.location.host ===  PLATFORM.global.document.location.host\r\n```\r\n\r\nIn fact, this is what is done in case of eventListener (mobile platform):\r\n```\r\nif (event.url.indexOf(redirectUri) !== 0) {\r\n```\r\n\r\nSo I'm not sure why the different behavior. For mobile platfrom the popup window is compared against the redirectUri, but for web plarform it compared always to the `document.location.host`."},"comment":{"url":"https://api.github.com/repos/SpoonX/aurelia-authentication/issues/comments/246147416","html_url":"https://github.com/SpoonX/aurelia-authentication/issues/248#issuecomment-246147416","issue_url":"https://api.github.com/repos/SpoonX/aurelia-authentication/issues/248","id":246147416,"user":{"login":"genadis","id":6747147,"avatar_url":"https://avatars.githubusercontent.com/u/6747147?v=3","gravatar_id":"","url":"https://api.github.com/users/genadis","html_url":"https://github.com/genadis","followers_url":"https://api.github.com/users/genadis/followers","following_url":"https://api.github.com/users/genadis/following{/other_user}","gists_url":"https://api.github.com/users/genadis/gists{/gist_id}","starred_url":"https://api.github.com/users/genadis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/genadis/subscriptions","organizations_url":"https://api.github.com/users/genadis/orgs","repos_url":"https://api.github.com/users/genadis/repos","events_url":"https://api.github.com/users/genadis/events{/privacy}","received_events_url":"https://api.github.com/users/genadis/received_events","type":"User","site_admin":false},"created_at":"2016-09-10T22:23:05Z","updated_at":"2016-09-10T22:23:05Z","body":"Yep.. with version: npm:aurelia-authentication@3.0.0-rc9 it's working (quick test done with google and facebook providers).\r\n\r\nBut if you merge the test branch with the change of comparing to the redirectUri, it will break.\r\n\r\nPlease if you merge the test branch, add the listening to the `message` event functionality."}}
{"actor":{"display_login":"genadis"}}