{"action":"created","issue":{"url":"https://api.github.com/repos/IdentityModel/oidc-client-js/issues/661","repository_url":"https://api.github.com/repos/IdentityModel/oidc-client-js","labels_url":"https://api.github.com/repos/IdentityModel/oidc-client-js/issues/661/labels{/name}","comments_url":"https://api.github.com/repos/IdentityModel/oidc-client-js/issues/661/comments","events_url":"https://api.github.com/repos/IdentityModel/oidc-client-js/issues/661/events","html_url":"https://github.com/IdentityModel/oidc-client-js/issues/661","id":358878138,"node_id":"MDU6SXNzdWUzNTg4NzgxMzg=","number":661,"title":"Oidc client with Google OAuth implicitflow signout issue","user":{"login":"kiranjulapalli","id":1904652,"node_id":"MDQ6VXNlcjE5MDQ2NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1904652?v=4","gravatar_id":"","url":"https://api.github.com/users/kiranjulapalli","html_url":"https://github.com/kiranjulapalli","followers_url":"https://api.github.com/users/kiranjulapalli/followers","following_url":"https://api.github.com/users/kiranjulapalli/following{/other_user}","gists_url":"https://api.github.com/users/kiranjulapalli/gists{/gist_id}","starred_url":"https://api.github.com/users/kiranjulapalli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiranjulapalli/subscriptions","organizations_url":"https://api.github.com/users/kiranjulapalli/orgs","repos_url":"https://api.github.com/users/kiranjulapalli/repos","events_url":"https://api.github.com/users/kiranjulapalli/events{/privacy}","received_events_url":"https://api.github.com/users/kiranjulapalli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-11T04:01:40Z","updated_at":"2018-09-14T22:55:50Z","closed_at":null,"author_association":"NONE","body":"Issue: In my angular app, when user clicks on logout button, following code gets called:\r\n\r\n`      <button *ngIf=\"isLoggedin()\" (click)=\"authService.logout()\">Logout</button>`\r\n\r\nImplementation of AuthService.logout\r\n```\r\n  logout(): Promise<any> {\r\n      return this._userManager.signoutRedirect();\r\n  }\r\n```\r\nAuthService constructor:\r\n\r\n```\r\n  constructor(private httpClient: HttpClient, private router: Router) {\r\n    var config = {\r\n      authority: Constants.stsAuthority,\r\n      client_id: Constants.clientId,\r\n      redirect_uri: '${Constants.clientRoot}assets/oidc-login-redirect.html',\r\n      scope: 'openid profile',\r\n      response_type: 'id_token token',\r\n      post_logout_redirect_uri: '${Constants.clientRoot}?postLogout=true',\r\n      userStore: new WebStorageStateStore({ store: window.localStorage }),\r\n    };\r\n    this._userManager = new UserManager(config);\r\n    this._userManager.getUser().then(user => {\r\n      if (user && !user.expired) {\r\n        this._user = user;\r\n      }\r\n    });\r\n  }\r\n```\r\n**Above call is throwing the following exception:\r\n`OidcClient.createSignoutRequest: No end session endpoint url returned`**\r\n\r\nUpon some research, it seems like When `userManager.signoutRedirect` is called, it is internally calling methods which endup in the below call in `oidc-client.js`:\r\n\r\nHowever, `end_session_endpoint` is not in the metadata of some of popular oauth providers and this method throws exception. Think this parameter should be made optional.\r\n\r\n```\r\n    OidcClient.prototype.createSignoutRequest = function createSignoutRequest() {\r\n        var _this3 = this;\r\n\r\n        var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\r\n            id_token_hint = _ref2.id_token_hint,\r\n            data = _ref2.data,\r\n            state = _ref2.state,\r\n            post_logout_redirect_uri = _ref2.post_logout_redirect_uri;\r\n\r\n        var stateStore = arguments[1];\r\n\r\n        _Log.Log.debug(\"OidcClient.createSignoutRequest\");\r\n\r\n        post_logout_redirect_uri = post_logout_redirect_uri || this._settings.post_logout_redirect_uri;\r\n\r\n        return this._metadataService.getEndSessionEndpoint().then(function (url) {\r\n            if (!url) {\r\n                _Log.Log.error(\"OidcClient.createSignoutRequest: No end session endpoint url returned\");\r\n                throw new Error(\"no end session endpoint\");\r\n            }\r\n\r\n            _Log.Log.debug(\"OidcClient.createSignoutRequest: Received end session endpoint\", url);\r\n\r\n            var request = new _SignoutRequest.SignoutRequest({\r\n                url: url,\r\n                id_token_hint: id_token_hint,\r\n                post_logout_redirect_uri: post_logout_redirect_uri,\r\n                data: data || state\r\n            });\r\n\r\n            var signoutState = request.state;\r\n            if (signoutState) {\r\n                _Log.Log.debug(\"OidcClient.createSignoutRequest: Signout request has state to persist\");\r\n\r\n                stateStore = stateStore || _this3._stateStore;\r\n                stateStore.set(signoutState.id, signoutState.toStorageString());\r\n            }\r\n\r\n            return request;\r\n        });\r\n    };\r\n```\r\n\r\nHere is more discussion on this for google: [Similar Github Issue at https://github.com/openid/AppAuth-iOS/issues/47](https://github.com/openid/AppAuth-iOS/issues/47)\r\n\r\nThere should be an option to just clear local storage and let user stay signed in for the provider unless the provider supports signing out just for this client. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/IdentityModel/oidc-client-js/issues/comments/421504884","html_url":"https://github.com/IdentityModel/oidc-client-js/issues/661#issuecomment-421504884","issue_url":"https://api.github.com/repos/IdentityModel/oidc-client-js/issues/661","id":421504884,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTUwNDg4NA==","user":{"login":"brockallen","id":649492,"node_id":"MDQ6VXNlcjY0OTQ5Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/649492?v=4","gravatar_id":"","url":"https://api.github.com/users/brockallen","html_url":"https://github.com/brockallen","followers_url":"https://api.github.com/users/brockallen/followers","following_url":"https://api.github.com/users/brockallen/following{/other_user}","gists_url":"https://api.github.com/users/brockallen/gists{/gist_id}","starred_url":"https://api.github.com/users/brockallen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brockallen/subscriptions","organizations_url":"https://api.github.com/users/brockallen/orgs","repos_url":"https://api.github.com/users/brockallen/repos","events_url":"https://api.github.com/users/brockallen/events{/privacy}","received_events_url":"https://api.github.com/users/brockallen/received_events","type":"User","site_admin":false},"created_at":"2018-09-14T22:55:50Z","updated_at":"2018-09-14T22:55:50Z","author_association":"MEMBER","body":">  OidcClient.createSignoutRequest: No end session endpoint url returned\r\n\r\nSounds like your token server doesn't support signout."}}
{"actor":{"display_login":"brockallen"}}