CAS with auth-proxy and mod_auth_cas

Trying to implement CAS login using mod_auth_cas and auth-proxy. using version 7.0.6.
My apache conf looks some thing like this:-

<VirtualHost *:80>
LoadModule auth_cas_module /usr/lib/apache2/modules/mod_auth_cas.so
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so

    ServerAdmin webmaster@localhost
    DocumentRoot /usr/share/grafana/
    CASLoginURL https://cas.example.com/cas/login
    CASValidateURL https://cas.example.com/cas/serviceValidate
    CASCookiePath /var/cache/apache2/mod_auth_cas/
    ProxyRequests Off
    ProxyPreserveHost On
    ProxyPass / http://localhost:3000/
    ProxyPassReverse / http://localhost:3000/
    <Proxy *>
            CASAuthNHeader REMOTE_USER
            AuthType CAS
            #CASScope /
            Require valid-user
            RewriteEngine On
            RewriteRule .* - [E=PROXY_USER:%{LA-U:REMOTE_USER},NS]
            RequestHeader set X-WEBAUTH-USER "%{PROXY_USER}e"
            RequestHeader set X-REMOTE-USER %{REMOTE_USER}s
         
    </Proxy>
   
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

The auth-proxy setting : -

[auth.proxy]
enabled = true
header_name = X-WEBAUTH-USER
header_property = username
auto_sign_up = true
sync_ttl = 60
enable_login_token= true

On opening http://localhost/ I am redirected to the CAS for authentication after successful authentication I am redirected to http://localhost/login that the Grafana authentication page.

My grafana logs : -

t=2020-07-17T08:19:54+0000 lvl=info msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=GET path=/ status=302 remote_addr=::1 time_ms=0 size=29 referer=

Also found this post


does this have to do anything with my issue?

I can’t figure out why I am redirected to login page again can anybody help me ?