How to create a Kibana Login Page

Hi!

I'm trying to get a login page for Kibana!

I already researched the similar discussions, but I still could not find an answer that was useful. And i'm a begginer in Kibana.

For now, I've created plugins for simple things and it worked! Now I created a plugin called 'login' and managed to edit the main file and make the form, my questions now are:

  1. how can I disable the sidebar menu (global_nav)? It needs to be hidden or not even loaded.
  2. how can I get the credentials registered in elastic to authenticate and send to the kibana dashboards?

ps: I don't have the x-pack plugin. I'm looking for some tips to make my own login page.
im working in 6.4.1. version

thank you
im sorry if i wasnt so clear.

1 Like

To create a custom login flow, the gist is that you'll need to make your plugin intercept requests and redirect to some login page if the user is not authenticated. Kibana uses Hapi, and you can use the server.auth API to control things. The server object you get in Kibana is basically just a modified Hapi server object.

how can I disable the sidebar menu (global_nav)? It needs to be hidden or not even loaded.

The easiest way to do that is to render some other page, one that doesn't render the sidebar at all. I don't think there's an API in the sidebar to enable and disable apps, but I may be wrong about that.

how can I get the credentials registered in elastic to authenticate and send to the kibana dashboards?

This'll require you to learn how Hapi's auth stuff works. When a user is authenticated, you'll need to track their session somewhere (JWT, cookies, etc), and that information will either be directly readable from the browser, or you'll need to inject information into the browser from the server. The later is the most likely scenario, and you can use the injectVars method to expose these values (it exposes them in Angular, but you can access them from anywhere in Angular context like you would any other injected dependency). Mixed with auth route controls, if a page loads, you know that a user is authenticated, and you can read auth details provided from the server.

2 Likes

Thank you so much Joe!

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