nordeck / jitsi-keycloak-adapter

Allow Jitsi to use Keycloak as an identity and OIDC provider. SSO support for Jitsi
Apache License 2.0
20 stars 9 forks source link

Login button in the profile settings modal is not intercepted #4

Closed devium closed 1 year ago

devium commented 1 year ago

Describe the bug

The adapter does not intercept presses to the "Login" button from within the profile settings. Instead the "username/password" modal pops up.

Steps To Reproduce

  1. Open a new Jitsi room and authenticate via Keycloak.
  2. Open an unauthenticated browser session (e.g. private window) and join the room.
  3. Go to profile settings and click "login".

Expected behavior

The guest user should be redirected to Keycloak and be requested to login.

Environment: Jitsi (Docker/Helm): stable-8960-1 jitsi-keycloak-adapter (Docker): v20230917

Additional context

The login button carries the ID #login_button but the interceptor only checks for #modal-dialog-ok-button: https://github.com/nordeck/jitsi-keycloak-adapter/blob/v20230917/templates/usr/share/jitsi-meet/body.html#L28 So this only captures the "I am the host" button.

Love this project btw! I just switched from https://github.com/D3473R/jitsi-keycloak and this one feels a lot cleaner.

emrahcom commented 1 year ago

Hi @devium, thank you for reporting this issue.

I think https://github.com/nordeck/jitsi-keycloak-adapter/commit/fcaee759d210b0c97443b97ded5d3cc0c0ccf6eb fixes the issue.

devium commented 1 year ago

Hi @devium, thank you for reporting this issue.

I think fcaee75 fixes the issue.

Thanks for the quick reply and fix. I will test it tomorrow with a new docker image. In the meantime though, I have doubts that this fixes the issue entirely:

const _button = document.getElementById("modal-dialog-ok-button");

This will not catch the login button since it has a different ID (login_button) than the IamHost button.

emrahcom commented 1 year ago

Login button of the profile setting opens the login form of Jitsi and the code catches the Login button of this page and redirection happens at this time, not while clicking the Login button.

BTW there is no change on the container side. You may use your current container with the updated body.html.

devium commented 1 year ago

Login button of the profile setting opens the login form of Jitsi and the code catches the Login button of this page and redirection happens at this time, not while clicking the Login button.

I see! I just tested the new version. It works now. Thanks again for the quick fix. This solves the issue for me.