see https://bshaffer.github.io/oauth2-server-php-docs/cookbook/