{"action":"created","issue":{"url":"https://api.github.com/repos/mauriciovigolo/keycloak-angular/issues/16","repository_url":"https://api.github.com/repos/mauriciovigolo/keycloak-angular","labels_url":"https://api.github.com/repos/mauriciovigolo/keycloak-angular/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/mauriciovigolo/keycloak-angular/issues/16/comments","events_url":"https://api.github.com/repos/mauriciovigolo/keycloak-angular/issues/16/events","html_url":"https://github.com/mauriciovigolo/keycloak-angular/issues/16","id":293705244,"number":16,"title":"Question about refreshToken concurrency","user":{"login":"frederikprijck","id":2146903,"avatar_url":"https://avatars0.githubusercontent.com/u/2146903?v=4","gravatar_id":"","url":"https://api.github.com/users/frederikprijck","html_url":"https://github.com/frederikprijck","followers_url":"https://api.github.com/users/frederikprijck/followers","following_url":"https://api.github.com/users/frederikprijck/following{/other_user}","gists_url":"https://api.github.com/users/frederikprijck/gists{/gist_id}","starred_url":"https://api.github.com/users/frederikprijck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frederikprijck/subscriptions","organizations_url":"https://api.github.com/users/frederikprijck/orgs","repos_url":"https://api.github.com/users/frederikprijck/repos","events_url":"https://api.github.com/users/frederikprijck/events{/privacy}","received_events_url":"https://api.github.com/users/frederikprijck/received_events","type":"User","site_admin":false},"labels":[{"id":685397013,"url":"https://api.github.com/repos/mauriciovigolo/keycloak-angular/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-02-01T22:22:33Z","updated_at":"2018-02-02T09:45:59Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I have a question about the current implementation of this library.\r\n\r\nImagine the following situation:\r\n\r\n- The angular application starts an Http request (request A) using the HttpClient\r\n- Request A will be intercepted by the interceptor\r\n- Taken that the token is invalid, a new call will be made to refresh the token before its being added to the header\r\n- Before the token refresh is finished (the call to keycloak is still ongoing) a new Http request (request B) is made using the HttpClient\r\n- Request B will be intercepted by the interceptor\r\n- The token is not refreshed yet, so it's still expired and another call will be made to keycloak to refresh the token.\r\n- We now have a concurrency issue.\r\n\r\nThis is incorrect behavior. However, if I understand the source code correct, this is how the library currently works.\r\n\r\nAre you interested to fix this? Coz I have a fix for this which I can contribute if u want, but it might require a few refactors in ur keycloak service.\r\n\r\nIf you are interested, maybe we can have a chat offline (skype, hangouts, gitter) ."},"comment":{"url":"https://api.github.com/repos/mauriciovigolo/keycloak-angular/issues/comments/362537457","html_url":"https://github.com/mauriciovigolo/keycloak-angular/issues/16#issuecomment-362537457","issue_url":"https://api.github.com/repos/mauriciovigolo/keycloak-angular/issues/16","id":362537457,"user":{"login":"frederikprijck","id":2146903,"avatar_url":"https://avatars0.githubusercontent.com/u/2146903?v=4","gravatar_id":"","url":"https://api.github.com/users/frederikprijck","html_url":"https://github.com/frederikprijck","followers_url":"https://api.github.com/users/frederikprijck/followers","following_url":"https://api.github.com/users/frederikprijck/following{/other_user}","gists_url":"https://api.github.com/users/frederikprijck/gists{/gist_id}","starred_url":"https://api.github.com/users/frederikprijck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frederikprijck/subscriptions","organizations_url":"https://api.github.com/users/frederikprijck/orgs","repos_url":"https://api.github.com/users/frederikprijck/repos","events_url":"https://api.github.com/users/frederikprijck/events{/privacy}","received_events_url":"https://api.github.com/users/frederikprijck/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T09:45:59Z","updated_at":"2018-02-02T09:45:59Z","author_association":"CONTRIBUTOR","body":"> Create a new Service for situations where you have a custom login page, for example: in nativescript app's to have a login workflow inside the application, to avoid a web view to finish the authentication flow.\r\n\r\nI have a service for this, maybe we can see how we can incorporate it."}}
{"actor":{"display_login":"frederikprijck"}}