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

UniFi ID SAML Error #141

Open
huslage opened this issue Aug 31, 2023 · 17 comments
Open

UniFi ID SAML Error #141

huslage opened this issue Aug 31, 2023 · 17 comments
Labels
bug Something isn't working stale Waiting for response for a while

Comments

@huslage
Copy link

huslage commented Aug 31, 2023

Describe the bug

I have set up a new SAML application in UniFi Identity (UID) that points to my Jellyfin instance. At first it was complaining about the ACS URL being wrong. It appears that the current documentation contains the wrong URL to be set up. After analyzing the error response, I put the correct ACS URL into the UID config. Now I'm getting a valid SAML Response, but the Linking page still shows an error: jellyfin log file extract

To Reproduce
Steps to reproduce the behavior:

  • Configure the saml endpoint by doing a POST to: /jellyfin/sso/SAML/Add/UID?api_key=[API_KEY] JSON Payload
  • Visit jellyfin/SSOViews/linking in the browser and click the + button.
  • SAML linking begins and the IdP sends back a success, however the linking fails with Error processing request. when redirected to jellyfin/sso/SAML/p/UID
  • Log file shows that the response was not parseable.
  • Use base64 -d -i file.b64 to verify that the response is indeed parseable (I can email you this base64 encoded response, but I don't want to share it publicly.)

Expected behavior
I would expect the successful response from the IdP would be parsed and the linking would succeed.

Screenshots
See this Gist

Configuration

See this Gist

Versions (please complete the following information):

  • OS: MacOS 13.5.1
  • Browser: Firefox
  • Jellyfin Version: 10.8.10
  • Plugin Version: 3.5.2.0

Additional context
Jellyfin Mac App from the website. Installed plugin from repo listed in README.md.

@huslage huslage added the bug Something isn't working label Aug 31, 2023
@9p4
Copy link
Owner

9p4 commented Aug 31, 2023

Does the certificate in the configuration have linebreaks?

@huslage
Copy link
Author

huslage commented Aug 31, 2023 via email

@9p4
Copy link
Owner

9p4 commented Aug 31, 2023

Is the Jellyfin server running on Windows, Linux, or something else?

@huslage
Copy link
Author

huslage commented Aug 31, 2023 via email

@9p4
Copy link
Owner

9p4 commented Sep 1, 2023

Is the SAML assertion you are using encrypted or just signed?

@huslage
Copy link
Author

huslage commented Sep 1, 2023 via email

@9p4
Copy link
Owner

9p4 commented Sep 1, 2023

Does SAML login function correctly?

@huslage
Copy link
Author

huslage commented Sep 1, 2023 via email

@9p4
Copy link
Owner

9p4 commented Sep 1, 2023

Not the linking, but if you just go to jellyfin/sso/SAML/p/UID, does the login succeed?

@huslage
Copy link
Author

huslage commented Sep 1, 2023 via email

@9p4
Copy link
Owner

9p4 commented Sep 1, 2023

Just to check the characters used in your SAML certificate, can you put the certificate into a file, then run cat certificatefile.txt | grep -o . | sort | uniq? This will give me a list of the characters. You might have a non-standard Base64 certificate that uses slightly different characters.

@9p4
Copy link
Owner

9p4 commented Sep 1, 2023

Furthermore, are the assertions signed or documents signed?

@huslage
Copy link
Author

huslage commented Sep 1, 2023

Here's the character list:

+
0
1
2
3
4
5
6
8
9
=
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z

Nothing strange there. The assertions and documents are both signed.

@9p4
Copy link
Owner

9p4 commented Sep 2, 2023

In my testing environment (and in the docs), only the document should be signed. Try turning off signed assertions?

@huslage
Copy link
Author

huslage commented Sep 2, 2023 via email

@9p4
Copy link
Owner

9p4 commented Sep 5, 2023

Enabling signed assertions in Keycloak still works for me. Unfortunately, I can't seem to get access to Unifi Identity, and it may make it harder for me to reproduce your issue. If you are willing, can you email me the unredacted public certificate that you are using? My contact information is at https://ersei.net/en/contact-me

@9p4
Copy link
Owner

9p4 commented Sep 26, 2023

Is there any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Waiting for response for a while
Projects
None yet
Development

No branches or pull requests

2 participants