mauriciovigolo / keycloak-angular

Easy Keycloak setup for Angular applications.
MIT License
721 stars 277 forks source link

Window Title not coming after adding canActivate on route of pop up window #358

Open mkmittalwabtec opened 2 years ago

mkmittalwabtec commented 2 years ago

I am trying to open pop up from main window, it's working fine without authentication, but after adding canActivate on route of pop up window(child), window title is not visible.

This is only happening with child popup windows, which is opening in new window.

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search for issues before submitting
- [ ] feature request

Versions.

"keycloak-angular": "^8.2.0",
"keycloak-js": "13.0.1",

Repro steps.

  1. This is how i added can Activate function. Its able to authenticate. { path: "alert", canActivate: [AppAuthGuard], loadChildren: () => import("./home/alert.module") .then(m => m.alertModule) },

  2. After that when i click to open child window, i am setting up title and other details

The log given by the failure.

Window instance not identified by the main window

Desired functionality.

It should authenticate without changing meta data of window pop up

jonkoops commented 2 years ago

Please include a reproducible code example if you want your issue to be resolved. I cannot infer what your problem is from the details you have provided here.

mkmittalwabtec commented 2 years ago

The problem is when pop up window is open its redirecting to keycloak server url for authentication because of that window title somehow not able to update, so is there any solution so that it wont redirect to keycloak, it will authenticate silently?

jonkoops commented 2 years ago

The README specifies how silent SSO can be enabled, this would not redirect the user to Keycloak. If the user is not authenticated you will have to manually call .login() in order to redirect them to Keycloak.