# HTTP 403: Ip Forbidden error when authenticating against Keycloak server

**URL:** https://discourse.jupyter.org/t/http-403-ip-forbidden-error-when-authenticating-against-keycloak-server/7744
**Category:** Zero to JupyterHub on Kubernetes
**Tags:** help-wanted
**Created:** [February 1, 2021, 12:18pm UTC](https://discourse.jupyter.org/t/http-403-ip-forbidden-error-when-authenticating-against-keycloak-server/7744 "2021-02-01T12:18:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![kmarkie](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/kmarkie/32/3626_2.png) [@kmarkie](https://discourse.jupyter.org/u/kmarkie)
#### Post date: [February 1, 2021, 12:18pm UTC](https://discourse.jupyter.org/t/http-403-ip-forbidden-error-when-authenticating-against-keycloak-server/7744/1 "2021-02-01T12:18:29Z")

</div>

Hi,

I’m new to Jupyterhub and I’m trying to configure it to use a Keycloak server for authentication.

This is my config.yaml:

```
proxy:
  secretToken: "<secret token>"
  service:
    loadBalancerIP: <ip address>
    
hub:
  config:
    Authenticator:
      auto_login: true
      enable_auth_state: true
    CryptKeeper:
      keys:
        - <key>
    GenericOAuthenticator:
      client_id: s2r-jupyterhub
      client_secret: <client secret>
      oauth_callback_url: http://<ip address>/hub/oauth_callback
      authorize_url: https://<keycloak url>/auth/realms/<realm>/protocol/openid-connect/auth
      token_url: https://<keycloak url>/auth/realms/<realm>/protocol/openid-connect/token
      userdata_url: https://<keycloak url>/auth/realms/<realm>/protocol/openid-connect/userinfo
      login_service: keycloak
      username_key: preferred_username
      userdata_params:
        state: state
    JupyterHub:
      authenticator_class: generic-oauth

```

However, after being directed to Keycloak then logging in and being redirected back to Jupyterhub, I am receiving this error:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/2/2f699109876d6e3cc1a58b3803ebb7cf782a5ac6.png)

The hub log says this:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/5/5e418366536878391d6d7c537891e09f0b65e986.png)

Any help or pointers would be greatly appreciated 🙂

---

<div class="post-metadata">

### Author: ![kmarkie](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/kmarkie/32/3626_2.png) [@kmarkie](https://discourse.jupyter.org/u/kmarkie)
#### Post date: [February 2, 2021, 10:28am UTC](https://discourse.jupyter.org/t/http-403-ip-forbidden-error-when-authenticating-against-keycloak-server/7744/2 "2021-02-02T10:28:54Z")

</div>

This was an issue on Keycloaks side, needed to add an entry to the firewall for the application.
