Skip to content

go2rtc_keycloak is a fork of the go2rtc project. The primary goal of this fork is to integrate Keycloak for securing access to the go2rtc application.

License

Notifications You must be signed in to change notification settings

asherAbecasiss/go2rtc_keycloak

 
 

Repository files navigation

go2rtc_keycloak

go2rtc_keycloak is a fork of the go2rtc project. The primary goal of this fork is to integrate Keycloak for securing access to the go2rtc application.

Note: This project is currently in development and is not production-ready. Please use it in test environments only and exercise caution before deploying in production. Additional testing and security hardening may be necessary for production use.

Table of Contents

Overview

go2rtc_keycloak aims to enhance the security of the go2rtc streaming server by adding authentication and authorization capabilities through Keycloak. This integration allows you to protect access to your streams and resources by requiring users to authenticate via Keycloak.

Features

  • Keycloak Integration: Protects go2rtc streams with Keycloak, allowing secure access management.
  • Role-Based Access Control: Define specific roles in Keycloak for accessing streams and resources.
  • JWT Validation: Verifies JSON Web Tokens (JWT) issued by Keycloak for secure access.

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/go2rtc_keycloak.git
    cd go2rtc_keycloak
  2. docker-compose:

        docker compose pull
        docker compose up -d
    
  3. Keycloak Setup:

    • Log in to your Keycloak server.
  • Create a new client in Keycloak specifically for go2rtc_keycloak.

    • Client ID: Choose a unique name, such as go2rtc_keycloak.
    • Client Protocol: Select openid-connect.
    • Access Type: Set to public client authentication off.
  • Configure the redirect URIs to include the URL where front dir app will be hosted, sveltekit app http://127.0.0.1:5173/*.

  • Assign roles as needed for controlling access to specific streams and resources.

  • Save the client settings

  • go to internal/keycloak/keycloak.go and edit the url for keycloak

      var (
          jwksURL = "http://localhost:8080/realms/{your-realm}/protocol/openid-connect/certs"
      )
  1. Sveltekit:

    • go to front dir
        pnpm i
    • go to front dir src/lib/keycloak.js and edit this:
    export const keycloak = new Keycloak({
    url: "http://{your-keycloak-server}:{keycloak-port}/",
        realm: "your-realm",
        clientId: "your-client_id",
    });
    • run the app:

      pnpm run dev
  2. run go2rtc:

        cd go2rtc_keycloak
        go run .

About

go2rtc_keycloak is a fork of the go2rtc project. The primary goal of this fork is to integrate Keycloak for securing access to the go2rtc application.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 88.6%
  • HTML 5.3%
  • JavaScript 3.3%
  • Svelte 1.9%
  • Dockerfile 0.4%
  • Shell 0.2%
  • Other 0.3%