# Why I can't get the request payload in plugin against kibana 6.2

**URL:** <https://discuss.elastic.co/t/why-i-cant-get-the-request-payload-in-plugin-against-kibana-6-2/126697>\
**Category:** Kibana\
**Created:** [April 4, 2018, 8:40am UTC](https://discuss.elastic.co/t/why-i-cant-get-the-request-payload-in-plugin-against-kibana-6-2/126697 "2018-04-04T08:40:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahrtr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahrtr/32/29551_2.png) [@ahrtr](https://discuss.elastic.co/u/ahrtr)\
**Post date:** [April 4, 2018, 8:40am UTC](https://discuss.elastic.co/t/why-i-cant-get-the-request-payload-in-plugin-against-kibana-6-2/126697/1 "2018-04-04T08:40:29Z")

</div>

I worked out a kibana plugin to protect kibana 6.2. I created a cookie-based authentication strategy as below, so it will be invoked for each request, basically it's working well.

> ```
> const cookieConfig = {
> password: 'fake_password_12345_to_protect_cookie',
> cookie: 'example_cookie',
> isSecure: false,
> validateFunc: async (request, session, callback) => {
> try {
> server.log(['example', 'info'], `method:path = ${request.method}: ${request.url.path}`);
> server.log(['example', 'info'], 'request query string = ' + JSON.stringify(request.query));
> server.log(['example', 'info'], 'request payload = ' + JSON.stringify(request.payload));
> ......
> 
> } catch (error) { 
> ......
> }
> },    
>   
> ttl: 60 * 60 * 1000
> };
> 
> ```

But when I tried to get each request's payload using request.payload, I got nothing. For example, When I opened a dashboard on kibana UI, the above validationFunc geneated the following log entries. From the browser's developer console, I saw there were some payload for the requests, but why I can't get the payload in the plugin? What did I miss? Note that the plugin is based on kibana 6.2, and the hapijs verson used by kibana is 14.2.0. Thanks.

> server log [08:21:47.868] [info][example] method:path = post: /api/saved\_objects/bulk\_get  
> server log [08:21:47.868] [info][example] request query string = {}  
> server log [08:21:47.868] [info][example] request payload = null
> 
> server log [08:21:49.083] [info][example] method:path = post: /api/saved\_objects/bulk\_get  
> server log [08:21:49.084] [info][example] request query string = {}  
> server log [08:21:49.084] [info][example] request payload = null
> 
> server log [08:21:50.180] [info][example] method:path = post: /elasticsearch/\_msearch  
> server log [08:21:50.184] [info][example] request query string = {}  
> server log [08:21:50.184] [info][example] request payload = null
> 
> server log [08:21:50.668] [info][example] method:path = post: /elasticsearch/\_msearch  
> server log [08:21:50.670] [info][example] request query string = {}  
> server log [08:21:50.670] [info][example] request payload = null

---

<div class="post-metadata">

**Author:** ![ahrtr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahrtr/32/29551_2.png) [@ahrtr](https://discuss.elastic.co/u/ahrtr)\
**Post date:** [April 4, 2018, 9:40am UTC](https://discuss.elastic.co/t/why-i-cant-get-the-request-payload-in-plugin-against-kibana-6-2/126697/2 "2018-04-04T09:40:13Z")

</div>

I just figured out the root cause. It's because that the payload authentication is diabled by default. Please refer to the following document,  
[https://hapijs.com/api/14.2.0#serverauthschemename-scheme](https://hapijs.com/api/14.2.0#serverauthschemename-scheme)

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [April 4, 2018, 2:11pm UTC](https://discuss.elastic.co/t/why-i-cant-get-the-request-payload-in-plugin-against-kibana-6-2/126697/3 "2018-04-04T14:11:31Z")

</div>

Thanks for sharing what you learnt! Useful for the community.

Cheers  
Rashmi

---

<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:** [May 2, 2018, 2:11pm UTC](https://discuss.elastic.co/t/why-i-cant-get-the-request-payload-in-plugin-against-kibana-6-2/126697/4 "2018-05-02T14:11:37Z")

</div>

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