# Using a test server Keycloak instance from 127.0.0.1

**URL:** <https://forum.keycloak.org/t/using-a-test-server-keycloak-instance-from-127-0-0-1/13656>\
**Category:** Getting advice\
**Created:** [February 16, 2022, 10:02pm UTC](https://forum.keycloak.org/t/using-a-test-server-keycloak-instance-from-127-0-0-1/13656 "2022-02-16T22:02:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dewmera](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@dewmera](https://forum.keycloak.org/u/dewmera)\
**Post date:** [February 16, 2022, 10:02pm UTC](https://forum.keycloak.org/t/using-a-test-server-keycloak-instance-from-127-0-0-1/13656/1 "2022-02-16T22:02:54Z")

</div>

Hi All,

I have a Keycloak instance deployed on a test server, brought up by docker-compose, behind a gateway. I have created a **my-web-app** client whos client protocol is openid-connect and access type is public. This client will authenticate users with the authorization code flow.

PROXY\_ADDRESS\_FORWARDING is set to true, and the FRONTEND\_URL variable is set to _test-server-address/auth_. I have configured the Valid Redirect URIs for **my-web-app** client to be test-server-address/\* and 127.0.0.1:8080/\*. The web origin is set to “+”. I have no issues when accessing the web-app from _test-server-address_, and can successfully authenticate.

I am however running into an issue when I’m developing locally, accessing my web-app from 127.0.0.1:8080 and attempting to connect to the test-server Keycloak for authentication.

- I am prompted with a login screen (url is still _127.0.0.1:8080/_)
- I submit my authentication details
- I receive the following error prompt “We are sorry… An error occurred, please login through your application”, but the url in the address bar has changed to _test-server-address/_:
- Checking the test-server keycloak logs, I see that there was an **invalid\_code** error.

I’m a bit stuck - Is what I’m trying to accomplish possible to setup?
