Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a sign-in button to the login page for each plugin that advertises a
login-methodfeature, so plugin-provided sign-in (for example OIDC/SSO) can be offered without a WebUI change per plugin.Draft: the
login-methodfeature contract below is a proposal and I would like feedback on it before it settles.Changes
LoginPage.tsx: shows an "or" divider and a "Sign in with {displayName}" button under Login for every login method. Clicking it navigates the browser to the plugin'sloginUrl, passing the currentredirectToasreturnUrl.src/core/utilities/loginMethods.ts: picks the anonymouslogin-methodfeatures out of the feature list and validates them. Only aloginUrlthat is a path on the same server is accepted (no absolute urls,//host, backslashes or other schemes), since it comes from plugin metadata.plugin/queries.ts,types/api/plugin.ts:usePluginFeaturesQueryforGET Plugin/Featuresand thePluginFeatureTypetype. The query only runs once the server isStarted.tests/core/utilities/loginMethods.test.ts: covers the filtering, the rejected urls and thereturnUrlhandling.Proposed contract
An anonymous plugin feature named
login-methodwith metadata:displayName: text for the buttonloginUrl: a path on this server that starts the sign-in and ends by sending the browser toreturnUrl(default/webui) with a session stored insessionStorage.state.apiSessionA plugin that implements it is Foowy/Shoko.Plugin.Oidc.
Checked in a headless browser against a build of this branch and that plugin: the button shows on the login page, signs in through an external provider and lands on the dashboard with a session.