Skip to content
An OAuth server application that handles incoming OAuth requests for Lichess.
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Initial commit. Jan 28, 2018
config Fixed a typo, referrer is with double R Feb 14, 2018
data Hooked up Monolog to log all PHP errors. Feb 6, 2018
public Hooked up Monolog to log all PHP errors. Feb 6, 2018
src/App Using sprintf instead of mutability. Feb 14, 2018
test/AppTest/Action Initial commit. Jan 28, 2018
.gitignore Removed the demo client Jan 29, 2018
LICENSE Initial commit Jan 19, 2018 fix readme typo Feb 4, 2018
composer.json Made sure the autoloader is always called Feb 6, 2018
composer.lock Set the version of monogdb to 1.0.* Feb 6, 2018
docker-compose.yml Disabled the nginx container since it doesn't work yet Feb 6, 2018
phpunit.xml.dist Initial commit. Jan 28, 2018


An OAuth server application that handles incoming OAuth requests for Lichess.


All commands are meant to be ran from the root of your project directory.

Clone the repository to your favourite destination path.

git clone

From here choose your preferred way of working.


Install the PHP dependencies via Docker:

docker run --rm -it -v $(pwd):/data chesszebra/composer:7.0 install

The OAuth server requires a public and private key, let's create them:

openssl genrsa -out data/private.key 2048
openssl rsa -in data/private.key -pubout -out data/public.key

We also need an encryption key, let's create it:

docker run --rm -it -v $(pwd):/data chesszebra/php:7.0-cli -r 'echo base64_encode(random_bytes(32)), PHP_EOL;'


Enter the correct values inside the configuration files we are about to create now. The configuration files should be self explanatory.

Create the local configuration file used to run the application:

cp config/autoload/local.php.dist config/autoload/local.php


NOTE: It could be that a config cache is created, make sure to remove data/config-cache.php in order for the config to be reloaded.


Depending on your preferred storage system, either enable the PDO or MongoDB dependencies. Also enter the correct database information.


If you want to override the HTML template, create a new Twig template templates/app/oauth-authorize-custom.html.twig. For an example, have a look at templates/app/oauth-authorize.html.twig. If the custom template does not exists, the application will automatically fallback to templates/app/oauth-authorize.html.twig.


If you are developing the application, it might be wise to enable the development configuration files. This will make development easier.

cp config/development.config.php.dist config/development.config.php
cp config/autoload/development.local.php.dist config/autoload/development.local.php

Demo Client

One could create a file public/demo-client.php or simply copy examples/demo-client.php to test the server.

You can’t perform that action at this time.