{"action":"created","issue":{"url":"https://api.github.com/repos/IdentityModel/oidc-client-js/issues/151","repository_url":"https://api.github.com/repos/IdentityModel/oidc-client-js","labels_url":"https://api.github.com/repos/IdentityModel/oidc-client-js/issues/151/labels{/name}","comments_url":"https://api.github.com/repos/IdentityModel/oidc-client-js/issues/151/comments","events_url":"https://api.github.com/repos/IdentityModel/oidc-client-js/issues/151/events","html_url":"https://github.com/IdentityModel/oidc-client-js/issues/151","id":183028691,"number":151,"title":"SilentRenew without id_token_hint causes AccessTokenExpiring timer to fire multiple times","user":{"login":"thecontrarycat","id":1482576,"avatar_url":"https://avatars.githubusercontent.com/u/1482576?v=3","gravatar_id":"","url":"https://api.github.com/users/thecontrarycat","html_url":"https://github.com/thecontrarycat","followers_url":"https://api.github.com/users/thecontrarycat/followers","following_url":"https://api.github.com/users/thecontrarycat/following{/other_user}","gists_url":"https://api.github.com/users/thecontrarycat/gists{/gist_id}","starred_url":"https://api.github.com/users/thecontrarycat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thecontrarycat/subscriptions","organizations_url":"https://api.github.com/users/thecontrarycat/orgs","repos_url":"https://api.github.com/users/thecontrarycat/repos","events_url":"https://api.github.com/users/thecontrarycat/events{/privacy}","received_events_url":"https://api.github.com/users/thecontrarycat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-14T11:37:49Z","updated_at":"2016-10-20T20:19:30Z","closed_at":null,"body":"When the accessTokenExpiring event fires, the SilentRenewService calls signinSilent() on the UserManager.\r\n\r\n```\r\n if (args.id_token_hint) {\r\n            setIdToken = Promise.resolve();\r\n        }\r\n        else {\r\n            setIdToken = this.getUser().then(user => {\r\n                args.id_token_hint = user && user.id_token;\r\n            });\r\n        }\r\n```\r\n\r\nIf args.id_token_hint is not set, getUser() is called.  Part of getUser() is that AccessTokenEvents.load(user) will be called, which (as the user token is still present and valid) immediately wires up a new accessTokenExpiring event to be fired 1 second later.\r\n\r\nThis sets off a chain reaction of continuous signinSilent() calls (and continuous calls to the authorize endpoint on the OIDC Provider) until the user has been authorised by a signinSilentCallback() which updates the token and ensures the next accessTokenExpiring event won't happen until the token actually approaches expiry.\r\n\r\nWith a slow oidc provider I was seeing dozens of calls to the provider until one finally succeeds to stop the chain reaction.\r\n\r\nSee https://gist.github.com/thecontrarycat/1e9b21abf29636ad5f028359366c23b2 for the full log produced from oidc-client."},"comment":{"url":"https://api.github.com/repos/IdentityModel/oidc-client-js/issues/comments/255216463","html_url":"https://github.com/IdentityModel/oidc-client-js/issues/151#issuecomment-255216463","issue_url":"https://api.github.com/repos/IdentityModel/oidc-client-js/issues/151","id":255216463,"user":{"login":"brockallen","id":649492,"avatar_url":"https://avatars.githubusercontent.com/u/649492?v=3","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":"2016-10-20T20:19:30Z","updated_at":"2016-10-20T20:19:30Z","body":"Ok thanks. I'll look into it."}}
{"actor":{"display_login":"brockallen"}}