Skip to content

Configuring OAuth via Keycloak

KISTERS WISKI deploys Keycloak as Identity Provider. In order to configure Keycloak for TISGraph, follow this guide:

Create Client in Keycloak

Firstly, navigate to https://wiski.example.com:7415/admin/master/console/#/kisters-water-default/clients and click "Create client".

In the wizard, configure the following

Step. NameValue
1. Client typeOpenID Connect
1. Client IDiteg-tisgraph-dev
1. NameITEG WISKI Test
2. Client authenticationOn
2. Standard flowOn
2. Direct access grantsOff
3. Root URL<empty>
3. Home URL<empty>
3. Valid redirect URIshttps://tisgraph.example.com/oauth-login/auth
3. Web originshttps://tisgraph.example.com

Navigate to the newly created client, open the tab "Credentials", and copy the "Client secret" to the clipboard.

Create client screenshot

Create client screenshot

Create client screenshot

Create client screenshot

Configure TISGraph

Configure org.clazzes.login.oauth. In at.iteg.tis.graph, configure users.suPrincipal and delegateLoginMechanism and apiSecurityContext. Open https://tisgraph.example.com/oauth-login/login in order to try or debug the OAuth authentication.

Configure IIS

If the IIS (Internet Information Services for Windows Server) is used as reverse proxy, make sure that /oauth-login is proxied to TISGraph running on localhost:8181. Furthermore, make sure that the HTTP headers HTTP_X_FORWARDED_HOST, HTTP_X_FORWARDED_PORT, HTTP_X_FORWARDED_PROTO are set correctly. This is necessary as TISGraph needs to construct a redirect_uri for the authentication flow.

xml
                <rule name="ReverseProxyInboundRuleOAuthLogin" stopProcessing="true">
                    <match url="^oauth-login/(.*)" />
                    <action type="Rewrite" url="http://localhost:8181/oauth-login/{R:1}" />
                    <serverVariables>
                        <set name="HTTP_X_FORWARDED_HOST" value="{HTTP_HOST}" />
                        <set name="HTTP_X_FORWARDED_PORT" value="443" />
                        <set name="HTTP_X_FORWARDED_PROTO" value="https" />
                    </serverVariables>
                </rule>

IIS screenshot

IIS screenshot