login username and password verification through postgres database


I am quite new to grafana. I have created some dashboards in grafana. I have a postgres datasource. Now I want to create the authentication part where user will enter username and password and then click on submit button. I have a user table in postgres and I want when user enter the login credential then grafana should check whether those credentials exists in the database. If exists then only it should allow to the dashboards. Like for normal web pages we create the login page and writes the query to check the credentials. In grafana How I can do that???