miroslavpejic85 / mirotalksfu

🏆 WebRTC - SFU - Simple, Secure, Scalable Real-Time Video Conferences Up to 8k, compatible with all browsers and platforms.
https://sfu.mirotalk.com
GNU Affero General Public License v3.0
2.15k stars 340 forks source link

OIDC options as "peer_name" #160

Closed nirokato closed 6 days ago

nirokato commented 4 months ago

Hello Miroslav,

Thank you for your hard work on Mirotalk SFU, it is impressive.

Feature request

If OIDC is enabled, there should be the option in app/src/config.js to set items from req.oidc.user as the peer_name.

When this option is set, peers cannot set their own peer_name.

The following options from the /profile endpoint would be the most useful: "name", "preferred_username", and "email".

{
  "sid": "1fbdc872-0d58-4ca4-860e-0b335ba53281",
  "jti": "7f5f08f0-88b2-42a7-a3d4-0349b499fd08",
  "sub": "e9f8eaf7-5823-41c6-ab6f-e93281ca1a4a",
  "typ": "ID",
  "session_state": "1fbdc872-0d58-4ca4-860e-0b335ba53281",
  "acr": "1",
  "name": "Andy Molenda",
  "preferred_username": "andymolenda",
  "locale": "en",
  "given_name": "Andy",
  "family_name": "Molenda",
  "email": "andymolenda@example.com"
}

Pros

This would allow for automatic name entry from OIDC, help prevent name collisions, and allow matching usernames to server-side recordings.

miroslavpejic85 commented 6 days ago

To add the configuration in the app/src/config.js file under the oidc section, update the file as follows:

oidc: {
    // Existing OIDC settings
    peer_name: {
        force: true,  // Enforce using profile data for peer_name
        email: true,  // Use email as peer_name
        name: false,  // Don't use full name (family_name + given_name)
    },
    // other oidc settings...
},
// other config settings...

Example Profile:

{
    "email": "miroslav.pejic.85@gmail.com",
    "family_name": "Pejic",
    "given_name": "Miroslav",
    "name": "Miroslav Pejic",
    "peer_name": { 
        "force": true, 
        "email": true, 
        "name": false
    }
}

Result:

mirotalk-sfu-oidc-profile

miroslavpejic85 commented 6 days ago

Thank you for your hard work on Mirotalk SFU, it is impressive.

Thank you so much for your kind words! I'm really glad you find MiroTalk SFU impressive. It’s been a great journey working on it, and your feedback means a lot. If you have any questions or ideas you'd like to explore, Feel free to join our community on Discord! You can connect with others and stay updated on all things MiroTalk SFU at https://discord.gg/rgGYfeYW3N. Looking forward to seeing you there!