Kibana 5 front end authentication

Hi I recently got my hands on kibana 5. Want to put front end authentication with the help of node.js and SQL. But I am unable to understand where should I start developing the authentication part?

Sharing your thoughts of program flow is greatly appreciated.

Thanks.

Kibana uses hapi to serve its pages. You could create a Kibana plugin that utilizes hapi's request/response lifecycle hooks to build an authentication plugin for Kibana. You can learn more about creating Kibana plugins here: https://github.com/elastic/kibana/wiki/Plugin-Resources

Note that Elastic provides a commercial security plugin for Kibana called Shield (part of x-pack in 5.0 onwards). You can learn more about Shield here: https://www.elastic.co/products/shield