{"action":"created","issue":{"url":"https://api.github.com/repos/sahat/satellizer/issues/915","repository_url":"https://api.github.com/repos/sahat/satellizer","labels_url":"https://api.github.com/repos/sahat/satellizer/issues/915/labels{/name}","comments_url":"https://api.github.com/repos/sahat/satellizer/issues/915/comments","events_url":"https://api.github.com/repos/sahat/satellizer/issues/915/events","html_url":"https://github.com/sahat/satellizer/issues/915","id":170956796,"number":915,"title":"Pop up window does not close","user":{"login":"freshdev1","id":14213594,"avatar_url":"https://avatars.githubusercontent.com/u/14213594?v=3","gravatar_id":"","url":"https://api.github.com/users/freshdev1","html_url":"https://github.com/freshdev1","followers_url":"https://api.github.com/users/freshdev1/followers","following_url":"https://api.github.com/users/freshdev1/following{/other_user}","gists_url":"https://api.github.com/users/freshdev1/gists{/gist_id}","starred_url":"https://api.github.com/users/freshdev1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freshdev1/subscriptions","organizations_url":"https://api.github.com/users/freshdev1/orgs","repos_url":"https://api.github.com/users/freshdev1/repos","events_url":"https://api.github.com/users/freshdev1/events{/privacy}","received_events_url":"https://api.github.com/users/freshdev1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-12T20:51:48Z","updated_at":"2016-08-12T20:54:45Z","closed_at":null,"body":"Hello everybody. I cannot get my pop up window closed despite getting `code` in my query string from my OAuth 2.0 provider. It keeps on fetching new code from my provider. Basically it keeps on making the `Authorize Request`. I cannot solve this, and its been 2 days since I am trying to solve this. This is what my implementation looks like:\r\n\r\n# $authProvider configurations:\r\n```\r\nsgsApp.config(['$authProvider', function ($authProvider) {\r\n    $authProvider.httpInterceptor = function () { return true; },\r\n    $authProvider.withCredentials = false;\r\n    $authProvider.tokenRoot = null;\r\n    $authProvider.baseUrl = 'http://localhost:62266/identity/connect';\r\n    $authProvider.loginUrl = '/token';\r\n    //$authProvider.signupUrl = '/auth/signup';\r\n    //$authProvider.unlinkUrl = '/auth/unlink/';\r\n    $authProvider.tokenName = 'token';\r\n    $authProvider.tokenPrefix = 'satellizer';\r\n    $authProvider.tokenHeader = 'Authorization';\r\n    $authProvider.tokenType = 'Bearer';\r\n    $authProvider.storageType = 'localStorage';\r\n\r\n    // Generic OAuth 2.0\r\n    $authProvider.oauth2({\r\n        name: 'QMSIdentitySrv',\r\n        url: window.location.protocol + \"//\" + window.location.host + \"/#/login\",\r\n        clientId: 'Test',\r\n        redirectUri: encodeURIComponent(window.location.protocol + \"//\" + window.location.host + \"/#/login\"),\r\n        authorizationEndpoint: \"http://localhost:62266/identity/connect/authorize\",\r\n        defaultUrlParams: ['client_id', 'scope', 'response_type', 'redirect_uri', 'state', 'nonce'],\r\n        requiredUrlParams: null,\r\n        optionalUrlParams: null,\r\n        scope: 'openid profile email',\r\n        scopePrefix: null,\r\n        scopeDelimiter: null,\r\n        state: function () {\r\n            return (Date.now() + \"\" + Math.random()).replace(\".\", \"\");\r\n        },\r\n        nonce: function () {\r\n            return (Date.now() + \"\" + Math.random()).replace(\".\", \"\");\r\n        },\r\n        oauthType: '2.0',\r\n        popupOptions: null,\r\n        responseType: 'code',\r\n        responseParams: {\r\n            code: 'code'\r\n        }\r\n    });\r\n}]);\r\n```\r\n### the above lines goes in the app.js\r\n\r\nThis is how things are invoked in Login Controller:\r\n```\r\n$auth.authenticate('QMSIdentitySrv')\r\n              .then(function (succeess) {\r\n            //toastr.success('You have successfully signed in with ' + provider + '!');\r\n            //$location.path('/');\r\n                  console.log(succeess);\r\n        })\r\n              .catch(function (error) {\r\n                  console.log(error);\r\n\r\n                  if (error.error) {\r\n            // Popup error - invalid redirect_uri, pressed cancel button, etc.\r\n            //toastr.error(error.error);\r\n                  } else if(error.data) {\r\n                          // HTTP response error from server\r\n                              //toastr.error(error.data.message, error.status);\r\n                  } else {\r\n                      //toastr.error(error);\r\n                  }\r\n                  });\r\n```\r\n\r\nPlease someone help me from the community. I have been now frustrated by not being able to solve this problem. :disappointed: "},"comment":{"url":"https://api.github.com/repos/sahat/satellizer/issues/comments/239557287","html_url":"https://github.com/sahat/satellizer/issues/915#issuecomment-239557287","issue_url":"https://api.github.com/repos/sahat/satellizer/issues/915","id":239557287,"user":{"login":"freshdev1","id":14213594,"avatar_url":"https://avatars.githubusercontent.com/u/14213594?v=3","gravatar_id":"","url":"https://api.github.com/users/freshdev1","html_url":"https://github.com/freshdev1","followers_url":"https://api.github.com/users/freshdev1/followers","following_url":"https://api.github.com/users/freshdev1/following{/other_user}","gists_url":"https://api.github.com/users/freshdev1/gists{/gist_id}","starred_url":"https://api.github.com/users/freshdev1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freshdev1/subscriptions","organizations_url":"https://api.github.com/users/freshdev1/orgs","repos_url":"https://api.github.com/users/freshdev1/repos","events_url":"https://api.github.com/users/freshdev1/events{/privacy}","received_events_url":"https://api.github.com/users/freshdev1/received_events","type":"User","site_admin":false},"created_at":"2016-08-12T20:54:45Z","updated_at":"2016-08-12T20:54:45Z","body":"The URL which receives the code parameter:\r\n```\r\nhttp://localhost:61991/#/login?code=0397ea45ace0f1dfb9f917de3109df66&state=147103521559504504141016528538&session_state=Dr7scon0gXa1Bxseos6fY2NPcZp1JlTfBl6C2-BH7qM.7608f99eb1d943fb1dc39b281773e98d\r\n```"}}
{"actor":{"display_login":"freshdev1"}}