Replace Basic Authentication with JWT Tokens, Added Login Page#2252
Replace Basic Authentication with JWT Tokens, Added Login Page#2252TheElixZammuto wants to merge 6 commits intomasterfrom
Conversation
44fdc58 to
8ba64ff
Compare
This comment was marked as spam.
This comment was marked as spam.
Simply to simplify the authentication methods and not supporting both of them. This could be useful in situations where we would like to add different/new types of authentication systems without having to deal with this. btw I'll let @ReenigneArcher and @cgutman decide on that, I don't have a very strong opinion on that |
|
I agree with Elix. Less code to maintain would be my preference. |
This comment was marked as spam.
This comment was marked as spam.
|
@Nonary are you using the API for anything? I thought you were parsing the logs files for your projects. We did a search on GitHub and didn't really find anyone doing anything with our API. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2252 +/- ##
=========================================
- Coverage 6.17% 6.16% -0.02%
=========================================
Files 86 86
Lines 17546 17644 +98
Branches 8190 8263 +73
=========================================
+ Hits 1083 1087 +4
+ Misses 15410 14725 -685
- Partials 1053 1832 +779
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Given that we are already refactoring stuff here, can we move out all authentication logic/implementation to another file like http_authenticator or something, and only call it here?
Would also make it easier to unit test, fix, replace or even support multiple auth styles in the future.
|
It looks like this PR has been idle for 90 days. If it's still something you're working on or would like to pursue, please leave a comment or update your branch. Otherwise, we'll be closing this PR in 10 days to reduce our backlog. Thanks! |
|
PR replaced by #2995. |
|
I'm overtaking this with #3999 Submitting comment so that those who were previously following this PR are notified that this feature might be added to sunshine coming soon. |
Description
This PR replaces the current Login Page (which is based of the Basic Authentication) with a custom Login Page that implements Cookies + JWT to handle the session system.
This allows us to customize the UX of the login page, and it's more compatible with password managers.
The JWT Key is generated on the fly by Sunshine on each boot and is kept in memory, this allows us to not fiddle with revocation lists and storing safely the encryption key. The only side effect is that the credentials will be invalidated on a Sunshine Reboot, but the Web UI is already capable to handle this edge case and show a login modal when the credentials expire without reloading the entiere page.
This breaks the current API Authentication, but nobody uses the Web UI API as far as we know. If so, let us know!
Screenshot
Issues Fixed or Closed
https://ideas.moonlight-stream.org/posts/329/sunshine-use-login-page-rather-than-login-prompt
Type of Change
.github/...)Checklist
Branch Updates
LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.