{"action":"opened","issue":{"url":"https://api.github.com/repos/openiddict/openiddict-core/issues/385","repository_url":"https://api.github.com/repos/openiddict/openiddict-core","labels_url":"https://api.github.com/repos/openiddict/openiddict-core/issues/385/labels{/name}","comments_url":"https://api.github.com/repos/openiddict/openiddict-core/issues/385/comments","events_url":"https://api.github.com/repos/openiddict/openiddict-core/issues/385/events","html_url":"https://github.com/openiddict/openiddict-core/issues/385","id":219649240,"number":385,"title":"Handling get/post auth failures","user":{"login":"toddtsic","id":9937583,"avatar_url":"https://avatars1.githubusercontent.com/u/9937583?v=3","gravatar_id":"","url":"https://api.github.com/users/toddtsic","html_url":"https://github.com/toddtsic","followers_url":"https://api.github.com/users/toddtsic/followers","following_url":"https://api.github.com/users/toddtsic/following{/other_user}","gists_url":"https://api.github.com/users/toddtsic/gists{/gist_id}","starred_url":"https://api.github.com/users/toddtsic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toddtsic/subscriptions","organizations_url":"https://api.github.com/users/toddtsic/orgs","repos_url":"https://api.github.com/users/toddtsic/repos","events_url":"https://api.github.com/users/toddtsic/events{/privacy}","received_events_url":"https://api.github.com/users/toddtsic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-05T16:55:11Z","updated_at":"2017-04-05T16:55:11Z","closed_at":null,"body":"I have a ScheduleRefresh() token method spinning in an Ionic2 app (comes from @Toxicable examples), works great when mobile app up and running (forces a refreshTokens every tokens.expires_in / 2 interval).\r\n\r\nI've noticed that if I have mobile app open, but turn off phone screen and then return > SetIdentityTokenLifetime later, and use the app, I'm failing on server calls.  Difficult for me to create a testing scenario and debug (working on this), but I'm suspicious its failing authorization because IdentyToken expired and a refreshTokens() wasn't called.\r\n\r\nI'm considering addressing by using  .retryWhen on all authentication-requiring posts/gets.\r\n\r\nFor example in my auth-http.service (from samples):\r\n\r\n    post(url: string, data: any): Observable<any> {\r\n        return this.getHeaders()\r\n            .flatMap((headers: Headers) => {\r\n                let options = new RequestOptions({ headers });\r\n                return this.http.post(this.baseUrl + url, data, options)\r\n                    // .cache()\r\n                    .map(this.checkForError)\r\n                    **.retryWhen(error => this.authtokenService.refreshTokens())**\r\n                    .catch(error => this.httpExceptions.handleError(error))\r\n                    .map(this.getJson);\r\n            });\r\n    }\r\n\r\nIs this doable? (seems an elegant solution, theorectically obviating the need for the ScheduleRefresh() method)\r\n\r\nI'll be testing, just looking for feedback, advise...\r\n\r\nThanks,\r\nTodd"}}
{"actor":{"display_login":"toddtsic"}}