-
Notifications
You must be signed in to change notification settings - Fork 30
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
Applied the Zitadel SSO guided #206
Open
aldervall
wants to merge
5
commits into
9p4:main
Choose a base branch
from
aldervall:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,8 @@ This section is broken into providers that support Role-Based Access Control (RB | |
- ✅ [authentik](#authentik) | ||
- [✅ Keycloak](#keycloak-oidc) | ||
- Both [OIDC](#keycloak-oidc) & [SAML](#keycloak-saml) | ||
|
||
- ✅ [Zitadel](#zitadel-oidc) | ||
|
||
### No RBAC Support | ||
|
||
- ✅ Google OIDC | ||
|
@@ -222,3 +223,131 @@ keycloak: | |
SamlClientId: <same-as-in-keycloak> | ||
SamlCertificate: <copied-from-xml-file> | ||
``` | ||
--- | ||
# Zitadel OIDC | ||
|
||
### Create a New Project in ZITADEL | ||
|
||
- Log in to your ZITADEL instance. | ||
- Create a new project and name it as desired. | ||
|
||
### Configure the Project for Authorization Code Flow | ||
|
||
- Select `CODE` as the flow type. | ||
|
||
![Authorization Code Flow Configuration](https://github.com/user-attachments/assets/c1bb9b0e-d719-4435-b89f-f6aa48504369) | ||
|
||
### Redirect URIs | ||
|
||
- `https://jellyfin.YOURSERVER.COM/sso/OID/r/zitadel` | ||
- `https://jellyfin.YOURSERVER.COM/sso/OID/redirect/zitadel` | ||
|
||
### Post Logout URI | ||
|
||
- `https://jellyfin.YOURSERVER.COM` | ||
|
||
- Click `Continue` and `Create`. | ||
|
||
### Copy Client Credentials | ||
|
||
- Copy your `Client Secret` and `Client ID` for later use. | ||
|
||
### Configure Roles in ZITADEL | ||
|
||
- Enable `Assert Roles on Authentication` and `Check authorization on Authentication`, then click `Save`. | ||
|
||
- Go to the Roles section. | ||
|
||
![Role Configuration](https://github.com/user-attachments/assets/7c11750f-0892-4244-a7f9-343292ac5576) | ||
|
||
### Create Groups | ||
|
||
- `jellyfin_user` | ||
- `jellyfin_tv` | ||
- `jellyfin_admin` | ||
|
||
![Group Creation](https://github.com/user-attachments/assets/3551a93b-58fa-492e-9cad-6fdaeb7f602d) | ||
|
||
- Copy your Organization's Resource ID from the Organization settings in ZITADEL. | ||
|
||
![Organization Resource ID](https://github.com/user-attachments/assets/f1ae6584-6307-405e-ad27-d137ad20586f) | ||
|
||
### Set Up SSO in Jellyfin | ||
|
||
- Install and configure the SSO plugin in Jellyfin. | ||
|
||
### Configure the following settings: | ||
|
||
![OID Configuration](https://github.com/user-attachments/assets/d18ae6d3-ff9c-42de-b2eb-25d14f225b0c) | ||
|
||
- **OID Endpoint:** `https://zitadel.YOURSERVER.COM/.well-known/openid-configuration` | ||
|
||
- **OpenID Client ID:** Enter your `Client ID` from ZITADEL. | ||
|
||
- **OID Secret:** Enter your `Client Secret` from ZITADEL. | ||
|
||
### Example Role Mappings | ||
|
||
Replace `{ORGANIZATIONID}` and `{PRIMARYDOMAIN.COM}` with your organization's details. | ||
|
||
```json | ||
{"jellyfin_tv":{"265153045849972739":"{demo-vendor.com}"}} | ||
{"jellyfin_admin":{"265153045849972739":"{demo-vendor.com}"}} | ||
``` | ||
|
||
### Admin Roles | ||
|
||
```json | ||
{"jellyfin_tv":{"265153045849972739":"{demo-vendor.com}"}} | ||
{"jellyfin_admin":{"265153045849972739":"{demo-vendor.com}"}} | ||
``` | ||
|
||
![Admin Roles Configuration](https://github.com/user-attachments/assets/bf0d51f8-1a53-4f60-9e6a-e6a336808c64) | ||
|
||
### Live TV Roles | ||
|
||
```json | ||
{"jellyfin_tv":{"265153045849972739":"{demo-vendor.com}"}} | ||
{"jellyfin_admin":{"265153045849972739":"{demo-vendor.com}"}} | ||
``` | ||
|
||
### Live TV Management Roles | ||
|
||
```json | ||
{"jellyfin_tv":{"265153045849972739":"{demo-vendor.com}"}} | ||
{"jellyfin_admin":{"265153045849972739":"{demo-vendor.com}"}} | ||
``` | ||
|
||
### Scopes and Claims | ||
|
||
Add the following scopes and claims: | ||
|
||
![Scopes and Claims](https://github.com/user-attachments/assets/7a677b29-9f8f-44fb-aeb8-65ff1f0341d3) | ||
|
||
- **Role Claims:** `urn:zitadel:iam:org:project:{projectResourceId}:roles` | ||
- **Scopes:** | ||
- `openid` | ||
- `email` | ||
- `profile` | ||
- `urn:zitadel:iam:org:project:id:zitadel:aud` | ||
- `urn:zitadel:iam:org:project:{projectResourceId}:roles` | ||
- **Set Default Provider:** `Jellyfin.Server.Implementations.Users.DefaultAuthenticationProvider` | ||
- **Set Default Username Claim:** `preferred_username` | ||
- **Scheme Override:** `https` | ||
|
||
- Save the configuration. | ||
|
||
### Add Users in ZITADEL | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't need this section |
||
|
||
- Add users to the project in ZITADEL and assign them to the appropriate role. | ||
|
||
> **Note:** Assigning multiple roles to a single user may cause issues in Jellyfin, resulting in a 'Permission Denied' error. | ||
|
||
![Permission Denied Error](https://github.com/user-attachments/assets/8b5fa68a-d337-4c15-a55b-0bfce881d2ee) | ||
|
||
### Test the SSO Setup | ||
|
||
- Navigate to `https://jellyfin.YOURSERVER.COM/sso/OID/start/zitadel` | ||
- Attempt to log in using SSO to verify the setup. | ||
|
||
--- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't need the trailing |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't need this section