mod_sts allows you to setup Apache as an API gateway. There is currently no built in binaries available. The following instructions can be used to build and install this module in Apache on Ubuntu 18.
sudo apt update
sudo apt install -y pkg-config make gcc gdb lcov valgrind vim curl iputils-ping wget
sudo apt install -y autoconf automake libtool
sudo apt install -y libssl-dev libjansson-dev libcurl4-openssl-dev check
sudo apt install -y apache2 apache2-dev
sudo apt install libxml2-dev libcjose-dev
git clone https://github.com/zmartzone/liboauth2.git
cd liboauth2/
./autogen.sh
./configure CFLAGS="-g -O0 -I/usr/include/apache2" LDFLAGS="-lrt"
sudo make install
git clone --recurse-submodules https://github.com/zmartzone/mod_sts
cd mod_sts/src/liboauth2-sts/
./autogen.sh
./configure CFLAGS="-g -O0 -I/usr/include/apache2" LDFLAGS="-lrt"
sudo make install
cd ~/mod_sts
./autogen.sh
./configure CFLAGS="-g -O0 -I/usr/include/apache2" LDFLAGS="-lrt"
sudo make
sudo make install
./libtool --finish /usr/local/lib
sudo echo "LoadModule sts_module /usr/lib/apache2/modules/mod_sts.so" | sudo tee /etc/apache2/mods-available/sts.load
sudo echo "LoadModule sts_module \"modules/mod_sts.so\"" | sudo tee /etc/apache2/mods-available/sts.conf
<VirtualHost *:80>
SSLProxyEngine on
LogLevel debug
# common settings
STSType otx
STSOTXEndpoint https://originps.auth0.com/oauth/token
STSOTXEndpointAuth client_secret_post client_id=C6El34j0DLpADA0luQYXL9Jdb5QJ70Yh&client_secret=*******
STSAcceptSourceTokenIn header
STSPassTargetTokenIn header name=Authorization
<Location /stock>
STSRequestParameter subject_token_type urn:ietf:params:oauth:token-type:access_token
STSRequestParameter audience http://api.zamd.net/stock
ProxyPass https://localhost:3000/1i3pno21
ProxyPassReverse https://localhost:3000/1i3pno21
</Location>
<Location /price>
STSRequestParameter subject_token_type urn:ietf:params:oauth:token-type:access_token
STSRequestParameter audience http://api.zamd.net/pricing
ProxyPass https://localhost:3000/1i3pno21
ProxyPassReverse https://localhost:3000/1i3pno21
</Location>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
</VirtualHost>