Add Header Authentication for SSO
#474
Open
Mikhail5555 wants to merge 6 commits from Mikhail5555/feature/remote-header-auth
into master
pull from: Mikhail5555/feature/remote-header-auth
merge into: topaLE:master
topaLE:1.6.X
topaLE:1.7.X
topaLE:1.9.X
topaLE:Nuckerr/master
topaLE:Saibamen/fix_871
topaLE:WillianRod/feat/add-favicon-badges
topaLE:andreasbrett/logging
topaLE:andreasbrett/securepush
topaLE:bertyhell/bugfix/heartbeat-bar-animation
topaLE:bertyhell/feature/monitor-checks
topaLE:bertyhell/feature/translations-extraction-script
topaLE:cert-notification
topaLE:chakflying/settings-redesign
topaLE:debian-docker
topaLE:deefdragon/Template-Engine
topaLE:deefdragon/notif-tests
topaLE:e2e-test
topaLE:fdcastel/push-api-tags
topaLE:free-disk-space
topaLE:ivanbratovic/http-basicauth
topaLE:ivanbratovic/improve-translatables
topaLE:k8s-unofficial
topaLE:lucasra1/overall_status
topaLE:master
topaLE:mhkarimi1383/master
topaLE:mrphuongbn/master
topaLE:no-need-build
topaLE:philippdormann/feature/release-management
topaLE:proffalken/feature/680_add_labels_to_prometheus_metrics
topaLE:proffalken/feature/auto_build_and_release
topaLE:rebasesoftware/feature/request-with-http-proxy
topaLE:restructure-status-page
topaLE:sqlite-upgrade-prebuilt
topaLE:tarun7singh/master
topaLE:thomasleveil/feature/565-duplicate-monitor
topaLE:thomasleveil/ux/add-group-at-the-top
Reviewers
Request review
No reviewers
Labels
Something isn't working dependencies
Pull requests that update a dependency file discussion doc
Improvements or additions to documentation duplicate
This issue or pull request already exists feature-request
New feature or request good first issue
Good for newcomers hacktoberfest hacktoberfest-accepted help help wanted
Extra attention is needed High
High Priority impossible invalid
This doesn't seem right investigating k8s Low
Low Priority Medium
Medium Priority News prerelease bug question
Further information is requested resolved Unknown wontfix
This will not be worked on
Apply labels
Clear labels
bug
Something isn't working dependencies
Pull requests that update a dependency file discussion doc
Improvements or additions to documentation duplicate
This issue or pull request already exists feature-request
New feature or request good first issue
Good for newcomers hacktoberfest hacktoberfest-accepted help help wanted
Extra attention is needed High
High Priority impossible invalid
This doesn't seem right investigating k8s Low
Low Priority Medium
Medium Priority News prerelease bug question
Further information is requested resolved Unknown wontfix
This will not be worked on
No Label
bug
dependencies
discussion
doc
duplicate
feature-request
good first issue
hacktoberfest
hacktoberfest-accepted
help
help wanted
High
impossible
invalid
investigating
k8s
Low
Medium
News
prerelease bug
question
resolved
Unknown
wontfix
Milestone
Set milestone
Clear milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
Assign users
Clear assignees
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.
No due date set.
Dependencies
This pull request currently doesn't have any dependencies.
Reference in new issue
There is no content yet.
Delete Branch 'Mikhail5555/feature/remote-header-auth'
Deleting a branch is permanent. It CANNOT be undone. Continue?
No
Yes
When the env variable
REMOTE_USER_HEADER
is set, it will use the username provided in will skip both websocket and basic auth authentication.This allows for login through something like Authelia.
How to test:
REMOTE_USER_HEADER=Remote-User npm run start-server-dev
or addREMOTE_USER_HEADER
env variable to your docker container.Mikhail
in this case).Remote-User:Mikhail
.Mikhail
through the same mechanics as autoLogin uses.I believe it is duplicate of no auth feature.
I don't believe its the same, compleetly disabling authentication vs letting a reverse proxy handle the logged in user (and thus still allow different user accounts) is different.
Ah i though the debug logging was mostly lower level, but that seems to mostly be somewhat inconsistent.
Then security will be a big problem, because I believe strangers can login without password using http header.
I probably will implement
access token
for API features in the future.I suggest this feature should use that
access token
at that time.Http headers should only be used with a correctly configured reverse proxy. (thus disallowing end-user to set the REMOTE_USER_HEADER themselves). If you want to know some more about this I would advice you to read something like https://www.authelia.com/docs/deployment/supported-proxies/
If you want I can even demo it how I personally use it with SSO for multiple services (so you can see why I like it so much)
After read the authelia's doc, I now understand how it works.
But honestly I am personally not familiar with sso. I need more time to study the code changes and the workflow of sso. And make sure there is no vulnerabilities that ~hate~ hurt current users.
So it may take a longer time to get it merged. Thank you for the pr btw.
No problems, if you have any questions feel free to ask.
Btw, just a general question, is there a reason why the authentication is done over web-socket and not through a normal post request? (and then session stored in cookie instead of local storage token?) (Sorry if this is the incorrect place to ask this)
Just because the whole application is based on websocket and it is using local storage token.
OK that's a clear design choice.
I personally prefer to open the websocket connection after authenticating (unless you also have some public information over the websocket).
It makes it slightly easier since you only need to verify the jwt token once on connection, and after that all you can assume for each message that the user is authenticated.
Something like this: https://nuvalence.io/blog/websocket-token-based-authentication
Reviewers