-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Send 401 Unauthorized with WWW-Authenticate: Basic header to enable HTTP authentication via URL #7682
Comments
Also due to phishing security this approach doesn't work in several browsers, the browser will display a warning or error to alert the user about potential phishing alerts. Some of the browsers can be configured to allow it. See http://kb.mozillazine.org/Network.http.phishy-userpass-length As such alternative methods of authentication may be needed for other users. For example sending credentials or authentication token through URL parameters would work universally regardless of browser. For us the Samsung SmartTV builtin browser supports credentials in URL and Firefox can be configured to support it by changing the network.http.phishy-userpass-length setting. |
@morganchristiansson The Kibana security plugin supports sessions with cookies. What's the disadvantage to logging in via the login form, and relying on the existing session functionality in the Security plugin? Session timeout is configurable if that's the issue: https://www.elastic.co/guide/en/shield/2.3/kibana.html#shield-ui-settings
I don't think we'll ever support credentials passed via the URL. Support for the authorization header mainly exists for programmatic access. In the future, I imagine we'll implement some sort of token based system for API access. |
@Bargs if using ngnix proxy and sending the headers, shouldn't Kibana just pass this headers to Elasticsearch and then authenticate the user? |
Headers will work, but putting credentials in the URL will not. |
It's needed to display graphs and dashboards on tv monitors around the office. It is not possible to interactively login on them, so url authentication is needed |
@lukasolson any thoughts on this? Do we have any alternative that might be helpful? |
The simple solution for this case is to disable the shield Kibana plugin. If you're not using the login/logout capabilities, it shouldn't be of much use anyway. And if you disable the plugin, it should fall back to basic auth. Let me know if that helps! |
For this, i guess that it is needed a secondary Kibana instance pointing to the same Elasticsearch cluster. I think that one doesn't want to remove the plugin in the main Kibana instance that people will be logging, right? |
@gmoskovicz Yeah that solution would be fine. However we already have secondary instance, so this would be tertiary instance. And managing multiple instances is a bit of a hassle. We now need 3 kibana instances:
If configuring multiple Kibana profiles/backend connections from a single instance (like the Marvel plugin supports multiple clusters) then that might work for us. |
@Bargs From my understanding, passing the credentials in the url as @morganchristiansson suggested will result in them being passed as basic auth headers in most (if not all) browsers. |
@lukasolson In the OP @morganchristiansson said this:
I'm guess this is because we're redirecting to the login page? @morganchristiansson can you confirm that's what's happening? Also, what browser are you using? |
There's nowhere in the kibana or shield code where a If an Authorization header is sent, kibana&shield parses and recognizes it correctly. So my nginx hack to send |
A simple solution would be a new login URL. https://kibana.app/shield/login**-http-auth**?next=%2Fapp%2Fkibana#/disc.... This would then respond with 401 response and WWW-Authenticate header and allow login. |
I'm going to close this because current versions of X-Pack security should handle basic auth by default. Feel free to drop a comment here if the issue is still present. |
`v94.6.0` ⏩ `v95.0.0-backport.0` _[Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_ --- ## [`v95.0.0-backport.0`](https://github.com/elastic/eui/releases/v95.0.0-backport.0) **This is a backport release only intended for use by Kibana.** - Updated `EuiSteps` to support a new `titleSize="xxs"` style, which outputs the same title font size but smaller unnumbered step indicators ([#7813](elastic/eui#7813)) - Updated `EuiStepsHorizontal` to support a new `size="xs"` style, which outputs smaller unnumbered step indicators ([#7813](elastic/eui#7813)) - Updated `EuiStepNumber` to support new `titleSize="none"` which omits rendering step numbers, and will only render icons ([#7813](elastic/eui#7813)) ## [`v95.0.0`](https://github.com/elastic/eui/releases/v95.0.0) - Added `move` glyph to `EuiIcon` ([#7789](elastic/eui#7789)) - Updated `EuiBasicTable` and `EuiInMemoryTable`s with `selection` - the header row checkbox will now render an indeterminate state if some (but not all) rows are selected ([#7817](elastic/eui#7817)) **Bug fixes** - Fixed an `EuiDataGrid` visual bug when using `lineCount` row heights where the clamped text was still visible for some font sizes ([#7793](elastic/eui#7793)) - Fixed `EuiSearchBar`'s filter configs to always respect `autoClose: false` ([#7806](elastic/eui#7806)) **Breaking changes** - Removed deprecated `EUI_CHARTS_THEME_DARK`, `EUI_CHARTS_THEME_LIGHT` and `EUI_SPARKLINE_THEME_PARTIAL` exports ([#7682](elastic/eui#7682)) - Removed deprecated `euiPalettePositive` and `euiPaletteNegative`. Use `euiPaletteGreen` and `euiPaletteRed` instead ([#7808](elastic/eui#7808)) - Removed `type="inList"` from `EuiCheckbox`. Simply omit passing a `label` prop to render this style of checkbox ([#7814](elastic/eui#7814)) - Removed the unused `compressed` prop from `EuiCheckbox` and `EuiRadio`. This prop was not doing anything on individual components. ([#7818](elastic/eui#7818)) **CSS-in-JS conversions** - Converted `EuiCheckboxGroup` to Emotion ([#7818](elastic/eui#7818)) - Converted `EuiRadioGroup` to Emotion ([#7818](elastic/eui#7818)) --------- Co-authored-by: Cee Chen <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Cee Chen <[email protected]>
`v94.6.0` ⏩ `v95.0.0-backport.0` _[Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_ --- ## [`v95.0.0-backport.0`](https://github.com/elastic/eui/releases/v95.0.0-backport.0) **This is a backport release only intended for use by Kibana.** - Updated `EuiSteps` to support a new `titleSize="xxs"` style, which outputs the same title font size but smaller unnumbered step indicators ([elastic#7813](elastic/eui#7813)) - Updated `EuiStepsHorizontal` to support a new `size="xs"` style, which outputs smaller unnumbered step indicators ([elastic#7813](elastic/eui#7813)) - Updated `EuiStepNumber` to support new `titleSize="none"` which omits rendering step numbers, and will only render icons ([elastic#7813](elastic/eui#7813)) ## [`v95.0.0`](https://github.com/elastic/eui/releases/v95.0.0) - Added `move` glyph to `EuiIcon` ([elastic#7789](elastic/eui#7789)) - Updated `EuiBasicTable` and `EuiInMemoryTable`s with `selection` - the header row checkbox will now render an indeterminate state if some (but not all) rows are selected ([elastic#7817](elastic/eui#7817)) **Bug fixes** - Fixed an `EuiDataGrid` visual bug when using `lineCount` row heights where the clamped text was still visible for some font sizes ([elastic#7793](elastic/eui#7793)) - Fixed `EuiSearchBar`'s filter configs to always respect `autoClose: false` ([elastic#7806](elastic/eui#7806)) **Breaking changes** - Removed deprecated `EUI_CHARTS_THEME_DARK`, `EUI_CHARTS_THEME_LIGHT` and `EUI_SPARKLINE_THEME_PARTIAL` exports ([elastic#7682](elastic/eui#7682)) - Removed deprecated `euiPalettePositive` and `euiPaletteNegative`. Use `euiPaletteGreen` and `euiPaletteRed` instead ([elastic#7808](elastic/eui#7808)) - Removed `type="inList"` from `EuiCheckbox`. Simply omit passing a `label` prop to render this style of checkbox ([elastic#7814](elastic/eui#7814)) - Removed the unused `compressed` prop from `EuiCheckbox` and `EuiRadio`. This prop was not doing anything on individual components. ([elastic#7818](elastic/eui#7818)) **CSS-in-JS conversions** - Converted `EuiCheckboxGroup` to Emotion ([elastic#7818](elastic/eui#7818)) - Converted `EuiRadioGroup` to Emotion ([elastic#7818](elastic/eui#7818)) --------- Co-authored-by: Cee Chen <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Cee Chen <[email protected]>
We want to display authenticated Kibana dashboards on TV monitors that cycle through URLs to display various dashboards and data.
We've considered a number of different approaches to enable authentication and settled on passing credentials in URL like this:
https://user:[email protected]/
.Now this doesn't work because the webserver needs to send HTTP/1.1 401 Unauthorized with WWW-Authenticate: Basic header or the browser won't send its Authorization header.
From reviewing the shield plugin source code I've discovered that Shield accepts credentials via Authorization: header but it's not possible to trigger a 401 Unauthorized with WWW-Authenticate header to make the browser send it.
As such we've implemented a workaround where nginx will respond to requests without Authorization: header:
This enables authorization with HTTP auth and Kibana will parse the Authorization header correctly and grant access.
It would be great if Kibana with Shield could send this response could be made to return 401 Unauthorized with WWW-Authenticate: Basic header instead of rendering the current ajax based login screen.
The text was updated successfully, but these errors were encountered: