# Oauth 2.0 support in Logstash http output plugin

**URL:** https://discuss.elastic.co/t/oauth-2-0-support-in-logstash-http-output-plugin/86191
**Category:** Logstash
**Created:** [May 18, 2017, 4:16am UTC](https://discuss.elastic.co/t/oauth-2-0-support-in-logstash-http-output-plugin/86191 "2017-05-18T04:16:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![waqas\_ali\_razzaq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/waqas_ali_razzaq/32/18323_2.png) [@waqas\_ali\_razzaq](https://discuss.elastic.co/u/waqas_ali_razzaq)
#### Post date: [May 18, 2017, 4:16am UTC](https://discuss.elastic.co/t/oauth-2-0-support-in-logstash-http-output-plugin/86191/1 "2017-05-18T04:16:24Z")

</div>

I have a scenario where I want to publish the log events to the rest API using logstash http output plugin. My rest API has Oauth 2.0 authorization enabled. I have placed the access token in header section of http output plugin but I am getting 401 from the API server. I have tested the same token with SOAPUI and it works fine. Below are my logstash out configs. Any help or idea will be a great favour.

output {

```
if [type] == "error" {  

    if "loglevelerror" in [tags] {

        # *******************************************************************

        # Sending Messages to EventAPI

        # *******************************************************************

        http {

            url => "http://serverip:8281/events"

            headers => {

                "Authorization" => "Bearer c505e8f7-ecb3-346f-8216-f906965edc17"

                "RequestSource" => "agent"

                "Accept" => "application/json"

            }

    connect_timeout => 60

    socket_timeout => 60

            http_method => "post"

            format => "json"

            mapping => [my mappings]

        }

    }

}

```

}

---

<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: [June 15, 2017, 4:16am UTC](https://discuss.elastic.co/t/oauth-2-0-support-in-logstash-http-output-plugin/86191/2 "2017-06-15T04:16:43Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
