From 0950d0d15f499ee8a8ad876e12bbb530be1850a1 Mon Sep 17 00:00:00 2001 From: Evan Shortiss Date: Fri, 30 Aug 2019 10:54:07 +0100 Subject: [PATCH] add proxy configuration section to node.js adapter docs - fix: correct express to uppercase --- securing_apps/topics/oidc/nodejs-adapter.adoc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/securing_apps/topics/oidc/nodejs-adapter.adoc b/securing_apps/topics/oidc/nodejs-adapter.adoc index ddc4dc8010..44df708ced 100644 --- a/securing_apps/topics/oidc/nodejs-adapter.adoc +++ b/securing_apps/topics/oidc/nodejs-adapter.adoc @@ -116,6 +116,24 @@ Once instantiated, install the middleware into your connect-capable app: app.use( keycloak.middleware() ); ---- +==== Configuration for Proxies + +If the application is running behind a proxy that terminates an SSL connection +Express must be configured per the link:https://expressjs.com/en/guide/behind-proxies.html[express behind proxies] guide. +Using an incorrect proxy configuration can result in invalid redirect URIs +being generated. + +Example configuration: + +[source,javascript] +---- + var app = express(); + + app.set( 'trust proxy', true ); + + app.use( keycloak.middleware() ); +---- + ==== Checking Authentication To check that a user is authenticated before accessing a resource,