How to setup your own eXist-db OAuth interceptor?

In order to use your own redirect URL in OAuth configurations, you will need to host your own service that is reachable from the internet. In the below example you can host an instance of eXist-db. Sample perl code is also included with the WAK asset.

  1. Download and install eXist-db from: http://exist-db.org/exist/apps/homepage/index.html. Installation instructions can be found here http://exist-db.org/exist/apps/doc/quickstart.xml.

  2. Log into your eXist-db instance, go to Package Manager, and install the FunctX Library package.

  3. Follow this video on how to setup and validate the interceptor code: https://www.youtube.com/watch?v=XqG8qrE1bd0.

The validation step requires you to evaluate the following function within eXide editor which should return four XML elements:

rest:resource-functions()//rest:resource-function[starts-with(./@xquery-uri, '/db/apps/OAuthInterceptor')]

Once successfully configured, you can update your Redirect Uri inside Unity to http://{your exist host}:8080/exist/restxq/oauth-interceptor or https://{your exist host}:8443/exist/restxq/oauth-interceptor.

Last updated