Skip to content
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

HTTP auth proxy (nginx) not working #189

Closed
hathaway opened this issue Jun 26, 2013 · 11 comments
Closed

HTTP auth proxy (nginx) not working #189

hathaway opened this issue Jun 26, 2013 · 11 comments

Comments

@hathaway
Copy link

Based on the sample/nginx.conf example and comments, I have an nginx proxy setup with http auth. The only difference being that I have http auth required on the entire proxy but the comments indicate this is fine. I can go directly to the proxy at http://fqdn:8080 which prompts or the username/password and after authenticating I can receive responses in json from the elasticsearch server. But when I use this in the config.js nothing loads and the requests fail with a 401 error.

If I use the http://fqdn:9200 directly in config.js everything works fine but I'd like to put elasticsearch behind a proxy with http auth.

One the server nginx is logging the following error:

2013/06/26 21:24:36 [error] 5481#0: *1 no user/password was provided for basic authentication, client: 1.2.3.4, server: elasticsearch, request: "GET /_aliases HTTP/1.1", host: "fqdn:8080", referrer: "http://kibana.dev/"

It appears since kibana isn't sending a username/password the request for /_aliases is just failing instead of the browser prompting for authentication.

This seems like a bug but I may be missing something. Has anyone been able to get a similar setup working?

@rashidkpc
Copy link
Contributor

Interesting. Which browser is this?

@hathaway
Copy link
Author

hathaway commented Jul 7, 2013

I've tried in the latest versions of Chrome and Safari.

@rashidkpc
Copy link
Contributor

Not sure why this is happening, Kibana isn't responsible for sending the username/password. The browser should prompt for it. I'm using the same setup on demo.kibana.org.

@hathaway
Copy link
Author

hathaway commented Jul 8, 2013

I don't get a username/password prompt on demo.kibana.org. Is it just using a proxy without http auth? That seems to work fine. It's when I require HTTP auth to get to the ES server that Kibana stops working because it is not authenticating (401 error). However, when I hit the urls for the ES server directly in the browser, it does prompt for the username/password and works when I provide the credentials.

@rashidkpc
Copy link
Contributor

Try saving a dashboard, you should get a l/p prompt

@hathaway
Copy link
Author

hathaway commented Jul 8, 2013

No luck. It doesn't prompt for credentials. It flashes the green dialog saying it saved but doesn't actually save it. The list of dashboards remains empty. When I point directly to the ES server (no http auth) and do the same thing, it saves successfully and shows in the list.

I did also notice this in the console for Chrome:

XMLHttpRequest cannot load http://fqdn:8080/_aliases. Origin http://kibana.dev is not allowed by Access-Control-Allow-Origin.

I wonder if that could be affecting the browser prompting for the credentials? I'm running it locally for testing using pow.cx (that's where the .dev hostname comes from). The request is still making it the server as shown in the logs:

2013/07/08 14:28:01 [error] 5481#0: *1613 no user/password was provided for basic authentication, client: 1.2.3.4, server: elasticsearch, request: "GET /_aliases HTTP/1.1", host: "fqdn:8080", referrer: "http://kibana.dev/"

Does kibana have to run on the same hostname that it will be connecting to for ES?

@rashidkpc
Copy link
Contributor

Sorry, I meant try saving a dashboard on demo.kibana.org

And no, unless you've turned off the cors settings of elasticsearch, it does not need to run on the same host.

@hathaway
Copy link
Author

hathaway commented Jul 8, 2013

Ah, I see the prompt when saving a dashboard on the demo site. Should the same thing be happening when kibana initially loads and tries to pull data from ES via the http auth proxy?

@rashidkpc
Copy link
Contributor

I've just tested it with auth on both the static assets (kibana's files) and the proxy, and it works, correctly prompting me for a username and password before displaying anything

@hathaway
Copy link
Author

hathaway commented Jul 8, 2013

I must be doing something different.

Here is the nginx configuration I'm using. It is being installed by the elasticsearch::proxy recipe in the ES cookbook. This is setup on a server at fqdn.

Then I'm pointing the config.js.file to that proxy like this:

var config = new Settings(
{
  // By default this will attempt to reach ES at the same host you have
  // elasticsearch installed on. You probably want to set it to the FQDN of your
  // elasticsearch host
  //elasticsearch:    "http://"+window.location.hostname+":9200",
  elasticsearch: 'http://fqdn:8080',
  kibana_index:     "kibana-int",
  modules:          ['histogram','map','pie','table','stringquery','sort',
                    'timepicker','text','fields','hits','dashcontrol',
                    'column','derivequeries','trends','bettermap'],
  }
);

Any idea why this never prompts for the username/password in kibana?

@rashidkpc
Copy link
Contributor

Closing this as inactive.

harper-carroll pushed a commit to harper-carroll/kibana that referenced this issue Jul 11, 2016
kosabogi added a commit that referenced this issue Sep 24, 2024
## Overview

This update adds details to the Data Visualizer documentation,
specifying supported file formats and their size limits.
**Related issue:**
[#189](elastic/search-docs-team#189)

### Preview

[Machine Learning]()

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Sep 24, 2024
…c#193819)

## Overview

This update adds details to the Data Visualizer documentation,
specifying supported file formats and their size limits.
**Related issue:**
[elastic#189](elastic/search-docs-team#189)

### Preview

[Machine Learning]()

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
(cherry picked from commit 37af730)
kibanamachine added a commit that referenced this issue Sep 24, 2024
…193819) (#193883)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Updates file format details for Data Visualizer documentation
(#193819)](#193819)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"kosabogi","email":"105062005+kosabogi@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-09-24T14:37:43Z","message":"Updates
file format details for Data Visualizer documentation (#193819)\n\n##
Overview\r\n\r\nThis update adds details to the Data Visualizer
documentation,\r\nspecifying supported file formats and their size
limits.\r\n**Related
issue:**\r\n[#189](https://github.com/elastic/search-docs-team/issues/189)\r\n\r\n###
Preview\r\n\r\n[Machine
Learning]()\r\n\r\n---------\r\n\r\nCo-authored-by: Liam Thompson
<32779855+leemthompo@users.noreply.github.com>","sha":"37af7304f01776e3d89afcbe596a76048371cff8","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","release_note:skip","v9.0.0","v8.16.0","backport:version"],"title":"Updates
file format details for Data Visualizer
documentation","number":193819,"url":"https://github.com/elastic/kibana/pull/193819","mergeCommit":{"message":"Updates
file format details for Data Visualizer documentation (#193819)\n\n##
Overview\r\n\r\nThis update adds details to the Data Visualizer
documentation,\r\nspecifying supported file formats and their size
limits.\r\n**Related
issue:**\r\n[#189](https://github.com/elastic/search-docs-team/issues/189)\r\n\r\n###
Preview\r\n\r\n[Machine
Learning]()\r\n\r\n---------\r\n\r\nCo-authored-by: Liam Thompson
<32779855+leemthompo@users.noreply.github.com>","sha":"37af7304f01776e3d89afcbe596a76048371cff8"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193819","number":193819,"mergeCommit":{"message":"Updates
file format details for Data Visualizer documentation (#193819)\n\n##
Overview\r\n\r\nThis update adds details to the Data Visualizer
documentation,\r\nspecifying supported file formats and their size
limits.\r\n**Related
issue:**\r\n[#189](https://github.com/elastic/search-docs-team/issues/189)\r\n\r\n###
Preview\r\n\r\n[Machine
Learning]()\r\n\r\n---------\r\n\r\nCo-authored-by: Liam Thompson
<32779855+leemthompo@users.noreply.github.com>","sha":"37af7304f01776e3d89afcbe596a76048371cff8"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: kosabogi <105062005+kosabogi@users.noreply.github.com>
neptunian pushed a commit to neptunian/kibana that referenced this issue Oct 1, 2024
…lastic#193819) (elastic#193883)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Updates file format details for Data Visualizer documentation
(elastic#193819)](elastic#193819)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"kosabogi","email":"105062005+kosabogi@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-09-24T14:37:43Z","message":"Updates
file format details for Data Visualizer documentation (elastic#193819)\n\n##
Overview\r\n\r\nThis update adds details to the Data Visualizer
documentation,\r\nspecifying supported file formats and their size
limits.\r\n**Related
issue:**\r\n[elastic#189](https://github.com/elastic/search-docs-team/issues/189)\r\n\r\n###
Preview\r\n\r\n[Machine
Learning]()\r\n\r\n---------\r\n\r\nCo-authored-by: Liam Thompson
<32779855+leemthompo@users.noreply.github.com>","sha":"37af7304f01776e3d89afcbe596a76048371cff8","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","release_note:skip","v9.0.0","v8.16.0","backport:version"],"title":"Updates
file format details for Data Visualizer
documentation","number":193819,"url":"https://github.com/elastic/kibana/pull/193819","mergeCommit":{"message":"Updates
file format details for Data Visualizer documentation (elastic#193819)\n\n##
Overview\r\n\r\nThis update adds details to the Data Visualizer
documentation,\r\nspecifying supported file formats and their size
limits.\r\n**Related
issue:**\r\n[elastic#189](https://github.com/elastic/search-docs-team/issues/189)\r\n\r\n###
Preview\r\n\r\n[Machine
Learning]()\r\n\r\n---------\r\n\r\nCo-authored-by: Liam Thompson
<32779855+leemthompo@users.noreply.github.com>","sha":"37af7304f01776e3d89afcbe596a76048371cff8"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193819","number":193819,"mergeCommit":{"message":"Updates
file format details for Data Visualizer documentation (elastic#193819)\n\n##
Overview\r\n\r\nThis update adds details to the Data Visualizer
documentation,\r\nspecifying supported file formats and their size
limits.\r\n**Related
issue:**\r\n[elastic#189](https://github.com/elastic/search-docs-team/issues/189)\r\n\r\n###
Preview\r\n\r\n[Machine
Learning]()\r\n\r\n---------\r\n\r\nCo-authored-by: Liam Thompson
<32779855+leemthompo@users.noreply.github.com>","sha":"37af7304f01776e3d89afcbe596a76048371cff8"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: kosabogi <105062005+kosabogi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@hathaway @rashidkpc and others