Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not wait 3 seconds before the first message is send to check session iframe #750

Closed
valdian opened this issue May 20, 2020 · 6 comments · Fixed by #766
Closed

Do not wait 3 seconds before the first message is send to check session iframe #750

valdian opened this issue May 20, 2020 · 6 comments · Fixed by #766

Comments

@valdian
Copy link
Contributor

valdian commented May 20, 2020

When my Angular app starts and there are valid tokens in the local storage, the app intentionally does not display any content to the user until first "changed" or "unchanged" message is received from the check session iframe. I described it with more details here.

Everything works fine, but the problem is, that it takes too long. And the reason is, that there is waiting for 3 seconds before the first message is sent to the check session iframe. See check-session.service.ts, row 123.

Is there any reason why there is also this initial 3 seconds waiting?

  • If no, could pollServerSessionRecur() be called once also before setInterval? Like it is also in the pseudo-code in the specs.
  • If yes, could you make it configurable? For example by adding two configuration values, one for heartBeatInterval and one for the initial waiting, both with default value 3000.

Thanks in advance!

@FabianGosebrink
Copy link
Collaborator

Hey, thanks for the issue. May it be that you use the wrong event? In the beginning the authorize event is being sent. The Checksession is sent after the session has been checked. You can listen to both of them with the appropriate operators in rxjs. Or did I misunderstand you?

Thanks

@valdian
Copy link
Contributor Author

valdian commented May 23, 2020

@FabianGosebrink I went through the CheckSessionService again and realised that the process is different from previous versions and that code changes which would help me, would be a bit more complicated. Among others, I noticed the same thing as in issue #756. I will wait for how you handle it and then I will try to suggest some changes I need.

@valdian
Copy link
Contributor Author

valdian commented May 27, 2020

Btw, do you still maintain version 10 and plan next minor/patch releases for it?

@FabianGosebrink
Copy link
Collaborator

Hey @valdian , we will take a look at #756 but not maintain version 10 anymore. We recommend everyone to update to version 11. Of course we will take a look at the #756 issue and try to solve it. Feel free to provide a PR if you have the feeling to get on we are definitely open for this ;-)

@damienbod
Copy link
Owner

fix in Version 11.1.3

@valdian
Copy link
Contributor Author

valdian commented May 30, 2020

Hi, #761 does not solve my issue. It was only the first step. I created another pr #766 with what I need. Would you mind adding this one line to the CheckSessionService?

@FabianGosebrink You asked me if I use the proper event. I know that there are also other events, but I want to do also something like this:

// if there is a valid token in the storage, I want to check whether the user in the token is still logged in to the oidc provider
this.eventService
  .registerForEvents()
  .pipe(
    filter(
      notification =>
        notification.type === EventTypes.CheckSessionReceived
    ),
    take(1)
  )
  .subscribe(event => {
    if (event.value === 'unchanged') {
      // consider authorisation process to be finished
      // hide loader and display content to the user
    } else {
      this.oidcSecurityService.logoffLocal();
    }
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants