Connection refused on for generic oauth , after authorization by auth server

I’m trying to integrate my auth server for grafana genric oauth,The Grafana saying

In the log:

 t=2019-12-06T03:50:43+0000 lvl=info msg="state check" logger=oauth queryState=9afe6f66a4e1c1858ea9d9fdb49585603e8233a9a496059c33faa59c5b0d0a64 cookieState=9afe6f66a4e1c1858ea9d9fdb49585603e8233a9a496059c33faa59c5b0d0a64
grafana-dashbord_1  | t=2019-12-06T03:50:43+0000 lvl=eror msg=login.OAuthLogin(NewTransportWithCode) logger=context userId=0 orgId=1 uname= error="Post http://localhost:3004/oauth/token: dial tcp 127.0.0.1:3004: connect: connection refused"

here 127.0.0.1:3004 is my local generic oauth server IP

Your Grafana doesn’t have connectivity to your identity provider (“oauth”) server. Check your network setrings. If you are using containers then keep in mind that each container has own localhost.

I have similar type of issue in which it is saying as “state mismatch”. Please help me to solve it.
I also want to know what should I pass in client_secret in grafana.ini file

I have created a virtual host auth.local and refer it in grafana, then it says no host found . please find the logs in grafana bellow:

grafana-dashbord_1  | t=2019-12-06T10:10:56+0000 lvl=info msg="Request Completed" logger=context userId=0 orgId=1 uname= method=GET path=/login/generic_oauth status=302 remote_addr=172.18.0.1 time_ms=0 size=255 referer="https://grafana.local/login?redirect=%2F%3ForgId%3D1"
grafana-dashbord_1  | t=2019-12-06T10:10:57+0000 lvl=info msg="state check" logger=oauth queryState=08ebc3510c451d74ad93b4ad309d1321f78ef4b777f22338831600d8404eb2ce cookieState=08ebc3510c451d74ad93b4ad309d1321f78ef4b777f22338831600d8404eb2ce
grafana-dashbord_1  | t=2019-12-06T10:10:57+0000 lvl=eror msg=login.OAuthLogin(NewTransportWithCode) logger=context userId=0 orgId=1 uname= error="Post https://auth.local/oauth/token: dial tcp: lookup auth.local: no such host"
grafana-dashbord_1  | t=2019-12-06T10:10:57+0000 lvl=eror msg="Request Completed" logger=context userId=0 orgId=1 uname= method=GET path=/login/generic_oauth status=500 remote_addr=172.18.0.1 time_ms=119 size=1743 referer="https://grafana.local/login?redirect=%2F%3ForgId%3D1"

Looks like the issue is some where else, the call is intercepted before its even made in my case with the same error message