# Http polar authentication

**URL:** <https://discuss.elastic.co/t/http-polar-authentication/33366>\
**Category:** Logstash\
**Created:** [October 30, 2015, 12:45pm UTC](https://discuss.elastic.co/t/http-polar-authentication/33366 "2015-10-30T12:45:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ushadatt](https://avatars.discourse-cdn.com/v4/letter/u/edb3f5/32.png) [@ushadatt](https://discuss.elastic.co/u/ushadatt)\
**Post date:** [October 30, 2015, 12:45pm UTC](https://discuss.elastic.co/t/http-polar-authentication/33366/1 "2015-10-30T12:45:44Z")

</div>

I am using http polar to parse a json API with authentication required at the beginning.  
Its showing an error that the URL is incorrect. And when I am checking my config file using --configtest, its showing the conf file is OK.  
Where am I going wrong?  
Following is my code:

```
> input 
> {
> http_poller {
> urls => {
> test1 => "http://json-url-example"
> auth => {
> user => "user"
> password => "password"
> }

> }

> interval => 10830
> codec => "json"
> }
> }
```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 30, 2015, 6:24pm UTC](https://discuss.elastic.co/t/http-polar-authentication/33366/2 "2015-10-30T18:24:55Z")

</div>

> Its showing an error that the URL is incorrect.

Seeing the exact error message would've been useful.

Your configuration is indeed not correct. It needs to be like this:

```
http_poller {
  urls => {
    test1 => {
      url => "http://json-url-example"
      auth => {
        user => "user"
        password => "password"
      }
    }
  }
  interval => 10830
  codec => "json"
}

```

Indenting the configuration properly makes mistakes like this easier to spot.

---

<div class="post-metadata">

**Author:** ![ushadatt](https://avatars.discourse-cdn.com/v4/letter/u/edb3f5/32.png) [@ushadatt](https://discuss.elastic.co/u/ushadatt)\
**Post date:** [November 2, 2015, 5:44am UTC](https://discuss.elastic.co/t/http-polar-authentication/33366/3 "2015-11-02T05:44:59Z")

</div>

@magnusbaeck Thanks Magnus!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:24am UTC](https://discuss.elastic.co/t/http-polar-authentication/33366/4 "2017-07-06T05:24:38Z")

</div>

Closed on July 6, 2017, 5:24am UTC


