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

[GH-183] Add jaas support #219

Open
wants to merge 65 commits into
base: master
Choose a base branch
from

Conversation

raghavaggarwal2308
Copy link
Contributor

Summary

Most of the code here is from #185 . The person who created this PR was not responding to the review comments for a while. So, we recreated the same PR with the review comments fixed.

The review comments fixed are-

  1. Added i18n translation to texts in Jitsi plugin system console settings.
  2. Updated UI of system console to clarify the type of Jitsi server user will be using
  3. An error occurred when we were using the locally-generated private key to sign the JWT token for JaaS. That error is also fixed in this PR.

Screenshots

  1. Updated UI
    currently

  2. Updated description to clarify how to generate a private key
    Screenshot from 2022-07-11 18-34-53

Ticket

Fixes #183 (JWT Configuration with JaaS)

jasonblais and others added 30 commits July 13, 2020 07:30
1. Added translation to texts in jitsi custom settings
1. Upgraded UI of jitsi settings in system console.
1. Fixed linting errors.
2. Fixed error while using own generated private key.
1. Specified method to generate a new key pair in private key description.
1. Removed console statements.
2. Used ?? operator instead of ||.
3. Created constants for "RSA PRIVATE KEY" and "PRIVATE KEY".
1. Converted to class components.
2. Created common func for duplicate code.
3. Used mux router.
4. Removed use of "any".
…refactor the code for redux of Jaas (#11)

* [MI-2589]:Fixed the bug and refactor the code

* [MI-2589]:Refactoring the code

* [MI-2589]:Fixed self review fixes

* [MI-2589]:Fixed review fixes

* [MI-2589]:Fixed review comments
@Kshitij-Katiyar
Copy link

@mickmister This new commit mainly has 2 changes:-

  1. I removed the store and reducers which we have created for Jaas individually.
  2. The load config API was getting called when the mattermost page gets rendered but that API has a check auth which checks whether the user is logged in or not and if the user is not logged it will return the "Unauthorised" error and the redux state in the frontend will not get updated. So I created a dummy component that will get mounted on the user log in and call the API and update the states.

Comment on lines 65 to 67
const script = document.createElement('script');
script.type = 'text/javascript';
script.onload = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component could mount more than once over the course of a browser session. There may be implications if we load this script more than once, so we should avoid check if it's already been loaded before loading again.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mickmister Added the condition to check whether the script is already loaded or not.

* [MI-2589]:Fixed the bug and refactor the code

* [MI-2589]:Refactoring the code

* [MI-2589]:Fixed self review fixes

* [MI-2589]:Fixed review fixes

* [MI-2589]:Fixed review comments

* [MI-2735]:Added check for loaded script
@VincentSC
Copy link

Small remark: README.md needs an update too. But preferably as a follow-up PR, since this PR has been delayed for years already...

@VincentSC
Copy link

VincentSC commented Feb 13, 2023

For who wants to test, see #206 how to build. Use the gh pr checkout 219 to checkout this PR.

I'll be testing it out the coming weeks. I think it needs some more documentation, but that should not be obstructing for this PR

@VincentSC
Copy link

VincentSC commented Feb 14, 2023

Problems we found till now (everybody in EU):

  • doesn't handle high DPI very well. In some moments some UI elements were off-screen
  • for some users the video would freeze
  • audio and video were slightly out-of-sync
  • video would turn blurry once in a while

I think all of these problems can be seen as different problem from this PR, except maybe the first. We have not tested with Jitsi's public server.

@raghavaggarwal2308
Copy link
Contributor Author

@mickmister @VincentSC This PR has been on hold for a while. Should we assign this for QA review?

doesn't handle high DPI very well. In some moments some UI elements were off-screen

I am not sure if this is something we can handle as we are just sending a payload to an external Jitsi API. Can we create a separate issue for this if this is not concerning? So, this PR can be merged as it has been delayed a lot already.

@VincentSC
Copy link

@mickmister @VincentSC This PR has been on hold for a while. Should we assign this for QA review?

As the plugin has many problems (it does not build, as the dependencies are very outdated), I have not managed to test it yet. Even my comment of #206 (comment) is now outdated...

Suggestion for order of fixes:

  • update dependencies (so we can close Manual Build part is broken #206)
  • 8x8 support (this PR, rebased)
  • UI glitches (of later concern, needs new issue as suggested)

@VincentSC
Copy link

Can this be rebased against #237 ? Simply because that PR builds, and this one doesn't.

@mickmister
Copy link
Contributor

@raghavaggarwal2308 Can you please update your branch with master to so it includes #237?

@VincentSC
Copy link

It has been merged into master, I just saw.

@raghavaggarwal2308
Copy link
Contributor Author

@mickmister @VincentSC Updated

"react": "16.14.0",
"react-dom": "18.2.0",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is causing build errors for me. I removed it again and it built fine. There are some test failures, though, but I'm not sure if they are caused by this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Snektron It's building fine for me with this dependency and falling if I remove it. Also, this dependency is being used in the code, so I don't think it can be removed. Can you please share some screenshots of the errors you are facing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that if we are going to install react-dom, it should always have the same version number as react

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mickmister I have updated it in the last commit

server/api.go Outdated Show resolved Hide resolved
server/api.go Outdated Show resolved Hide resolved
@Snektron
Copy link

It seems to be working for me (after fixing above issues)

@VincentSC
Copy link

We tested for a few weeks. One big problem: every reconnect adds another MAU (Monthly Active User).
So it becomes more a pay-per-use or a pay-per-connection instead of a pay-per-user. :(

Got this as a reply from 8x8:

Regarding the MAU count, you can check our docs here, so in short we store a deviceId on the local storage of the browser when a user joins a meeting, if the user clears the cookies, switches browser or device it will join with a different deviceId thus it will be counted as an extra MAU.

@mickmister
Copy link
Contributor

Hi @VincentSC, thanks for reporting this.

every reconnect adds another MAU (Monthly Active User).

Do you happen to have any suggestions on how we might solve this on our end? I'm not 100% sure what is meant by "reconnect" here

Copy link
Contributor

@mickmister mickmister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did another passthrough with some comments

@@ -11,6 +11,8 @@ server/manifest.go

assets/i18n/translate.*.json

public/jaas
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this gitignored?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make dist will automatically generate folder named Jaas inside the public directory

webapp/tsconfig.json Outdated Show resolved Hide resolved
Comment on lines +73 to +77
const params = new URLSearchParams(window.location.search);
const jwt = params.get(JWT);
const meetingId = params.get(constants.MEETING_ID);

this.startJaaSMeetingWindow(jwt, meetingId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, there is a JWT token in the user's location URL, while in Mattermost? That seems unnecessary if that's the case

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please elaborate more on this comment?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ayusht2810 What is in window.location.search at the time of this code running? Is this in a Mattermost webapp context? Meaning is location.origin the Mattermost server at this time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mickmister Yes, the origin is the mattermost URL at this time, and the location.search contains the meeting ID and the JWT token.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mickmister mickmister requested a review from hanzei March 14, 2024 06:21
@hanzei hanzei removed their request for review March 15, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JWT Configuration with Jaas