Wordpress OAuth2 Proxy
A reverse proxy using WP OAuth Server as an authentication scheme.
You can use it to expose any internal service to your Wordpress users.
Install the Wordpress plugin
First, you need to install WP OAuth
Server on your Wordpress site.
$ wp plugin install --activate oauth2-provider
Create a new client
page, click "Add New Client", and set the redirect URI to
YOUR_SERVICE is the
public name of your
Copy the Client ID and Secret for the client from this page.
Configure the proxy
docker-compose.example.yml into your project, and adjust the environment
variables as appropriate, then run
|HOST||The external hostname for your service|
|TARGET||The internal hostname of the service to expose through the authenticated proxy. Commonly a linked image.|
|TARGET_SCHEME||"http" or "https"|
|TARGET_PREPEND||A path to be prepended to every request through the proxy|
|HTTPS_FORCE||Enable to redirect all non-https requests|
|KEY_FILE||Path to a TLS certificate key|
|CERT_FILE||Path to a TLS certificate|
|DB_URI||A MongoDB database (by default running in a linked container)|
|SESSION_SECRET||Change this to any random string|
|OAUTH_CLIENT_ID||The Client ID you created in Wordpress.|
|OAUTH_CLIENT_SECRET||The Secret you created in Wordpress.|
|OAUTH_CALLBACK_URL||Prefix with the external URI of your service (such as a CNAME pointing to this Docker host). The
|SECRET_TOKEN_HEADER||Optionally accept a secret token on this header for unauthenticated requests ($SECRET_TOKEN) (for example,
|SECRET_TOKEN||A secret token which must match $SECRET_TOKEN_HEADER if enabled and the request is not authenticated by oAuth.|
Make sure that TARGET is not publicly accessible, or
unauthenticated users can simply ignore your reverse proxy!
With the proxy up and running, open the site in your browser, and verify the login process.
You will need
$ git clone email@example.com:logankoester/wordpress-oauth2-proxy.git $ cd wordpress-oauth2-proxy $ mv docker-compose.example.yml docker-compose.yml # Modify docker-compose.yml for your environment... $ docker-compose up
Copyright (c) 2015 Logan Koester. Released under the MIT license. See
LICENSE for details.