-
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
Implement Canonical Linking + Self Service #34
Conversation
f27cfeb
to
5e7b9b0
Compare
1679d1a
to
52b1ebf
Compare
@9p4 ready for review - so far I've implemented the backend, and just need to implement the view for user linking, which should be straightforward. (I also need to implement some un-linking stuff but it shouldn't be hard) For now, I'd like to move the next part of this (frontend, deletion) to a separate issue, and get this merged, and a new release out. When this is fully finished, maybe a major version increment would be appropriate. |
ca5481d
to
d65fb38
Compare
4215a63
to
7c3dff1
Compare
Okay, I've implemented a rudimentary UI for users to link their accounts - For now it doesn't actually seem to be working on non-admins, I'm not sure about why |
I think that the best way to go about this is to ignore the |
It sounds like you're suggesting we should remove the part of the code that attempts to use I'd like to leave breaking changes out of this PR, as presently, the behaviour introduced here should be backwards compatible with previous behaviour, while being resilient to user-name change ( If it had to create a user, or match on name, it creates a link Subsequent logins will find the linked The plugin is still in an early iteration, and we can semver the breaking change, so I don't think this is out of the question. One solution is, if a request does indeed make a new account, after successful auth, redirect the user to a page where they update their username. Although jellyfin doesn't appear to expose a view in the web-client for regular users to update their username, we have a few options: Use their endpoint: https://github.com/jellyfin/jellyfin/blob/master/Jellyfin.Api/Controllers/UserController.cs#L349-L382 in a custom view Or implement our own endpoint that only allows config of the username. Personally I'd rather this as it'll be a simpler API call, and it's pretty easy to write the method. |
IMO it's fine to have breaking changes at the moment. This plugin isn't quite at release (or at beta for that matter), and I hope that everyone knows that. If making a breaking change during this part of the development phase improves the plugin, I would say to go for it. As for updating the user, might as well use their API for it. During linking, I'm sure that the user would like to change more than just their username, so might as well allow it and reduce complexity on our end. |
You're probably right. I don't like the idea of having this weird funky fallback
It wouldn't really reduce complexity tbh, we'd have to implement the userDto data structure on the frontend. |
Development has stalled slightly because I've been unable to access the config ui views as non-admin users, so I've been unable to implement a linking UI Oddly enough, other people in the jf Dev matrix room haven't been able to reproduce the issue of not being able to access plugin views on non admin accounts. Because of the breaking changes we proposed around what OIDC property to use as cname, we basically need to bring the linking UI functionality so this isn't a backwards step, but I need to figure out why I can't access plugin views, and whether we need to roll our own html webresponse as a workaround, similar to how you did the client-side redirect UPDATE - Actually, others could reproduce this issue. I'm unclear if its a bug or a feature |
4605d74
to
c85528c
Compare
Hm, this isn't the first time I've stuffed these paths up like this.
That's not a bug (not our bug at least), that's expected, and the entire reason the SSOViews controller exists |
It's a Jellyfin config under the networking admin page |
Thanks, I'll check it out and debug what exactly is breaking - I'll do that now before I get distracted |
This was a bug in the snippet I copied from https://github.com/jellyfin/jellyfin-web/blob/9067b0e397cc8b38635d661ce86ddd83194f3202/src/scripts/clientUtils.js#L19-L76 Basically, their implementation searched for a Should be fixed by 510624f |
Use ApiClient.getUrl to get base urls for links Per 9p4#34 (comment)
a39502d
to
61ffb26
Compare
Use ApiClient.getUrl to get base urls for links Per 9p4#34 (comment)
Add js apiclient init module
Resolves #28
MVP finished, enough to improve functionality & enable bigger changes.
Future work (Another PR)
Backend:
preferred_username
from canonical linkingFrontend:
Thanks completed within this PR
Currently I've implemented an internal data structure for linking user accounts to canonical names, and an endpoint for users to register their own canonical names with these links.
The endpoint should allow admins to create links for any user, and any user can create links for only themselves.
The flow is as follows:
server/sso/{mode}/p/{provider}/isLinking=true
to initiate a SSO flow - the provider redirects back to the "normal" callback page, which then posts to the account linking API which valdiates the auth state, and creates the link.TimedAuthorizationState
that indicates whether that flow state is for a linking flow, or auth flow.Task list:
Backend:
CanonicalName : Jellyfin Name
toCanonicalName : Jellyfin Id
Allow user registration that support friendly names (Without admin fixup afterwards)as follows:
Frontend