Issue in setting up Jupyterhub OAuth

I’m trying to setup jupyterhub authentication using my on-premise oauth service. I’m using Generic Oauthenticator.
I’m doing configurations for oauth in 2 files:

  1. configmap for hub deployment: In data.hub.extraENV , I have 3 env variables - OAUTH2_AUTHORIZE_URI, OAUTH2_TOKEN_URL and OAUTH2_CALLBACK_URL
    and in data.auth.type = “myservice” , data.auth.custom.classname = oauthenticator.generic.GENERICOAUTH and also client_id, token_url and userdata_url in config.
    if auth_type==‘myservice’:
    setting these variables - authenticator-class, client_id, client_secret, token_url, userdata_url etc.

Now when I’m deploying and go to the url, it redirects me to this url:

And in browser it gives this error:

This page not working redirected you too many times.

How can I resolve this?