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

[Question]: Logout without redirect in multiConfig enviroment #1727

Open
majkers opened this issue Apr 4, 2023 · 2 comments
Open

[Question]: Logout without redirect in multiConfig enviroment #1727

majkers opened this issue Apr 4, 2023 · 2 comments
Labels

Comments

@majkers
Copy link

majkers commented Apr 4, 2023

What Version of the library are you using?
15.0.3

Question
Hi, Sorry for lack in my knowledge but I stuck at something. I am preparing an app with protected all routes and with two configs pointing to keycloak. One is for logging in to the app and the other is for signing documents for inside other's user session. Eg. One user is logged in and there comes the other one, grabs the keyboard and the mouse and presses Sign button and has to log in (using pop up method). After signature being done, he logges out and first user can do what he wants to do from his session.
Like I said before my all routes are protected so I have a callbackRoute like it was said in docs and
#1708 and #1549 but with my own guard.
And now the clue. How can I obtain a result when second user logges out and my application do not redirect to any URL? I know I can use logoffLocal method but it is not the case because session stays on the server. I want to leave application to first user exactly where it was. Ie. at the exact same routePath he was before second usered logged in.
In case of misunderstadings, let me know so I can explain more clearly.

@majkers
Copy link
Author

majkers commented Apr 6, 2023

Or maybe is it possible to add method logoutInPopUp so the redirect wont affect main application window?

@majkers
Copy link
Author

majkers commented Apr 6, 2023

@FabianGosebrink sorry to call you this way but I need help with this. Do You think that logout in popup method would be OK?

this.oidcSecurityService.getEndSessionUrl(undefined, 'myConfigId')
            .pipe(
                first(),
                filter((url: string | null) => !!url),
                switchMap((url: string | null) => {
                    return this.oidcSecurityService.getConfiguration('myConfigId')
                        .pipe(
                            first(),
                            tap((configuration: OpenIdConfiguration) => {
                                this.oidcSecurityService.logoffLocal('myConfigId');
                                const somePopupOptions = {width: 500, height: 500, left: 50, top: 50};
                                this.popUpService.openPopUp(url || '', somePopupOptions, configuration);
                            })
                        )
                })
            )
            .subscribe();

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

No branches or pull requests

1 participant