Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here


**DEPRECATED** Example for OAuth 2 Server. See instead.

Subscribe to updates I use example-oauth2-server

Statistics on example-oauth2-server

Number of watchers on Github 201
Number of open issues 7
Average time to close an issue 6 months
Main language Python
Average time to merge a PR about 1 month
Open pull requests 6+
Closed pull requests 2+
Last commit about 2 years ago
Repo Created over 6 years ago
Repo Last Updated almost 2 years ago
Size 120 KB
Organization / Authorlepture
Page Updated
Do you use example-oauth2-server? Leave a review!
View open issues (7)
View example-oauth2-server activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating example-oauth2-server for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Example for OAuth 2 Server

This is an example of OAuth 2 Server.

Find more details on


$ pip install -r requirements.txt


  1. Start your provider server with:

    $ python
  2. Visit and fill a username.


  3. And then visit


  4. Take the client key and client secret, and modify our script with the key and secret. Specifically update CLIENT_ID and CLIENT_SECRET variables on lines 5-6.

  5. Start the client server with:

    $ python
  6. Visit http://localhost:8000, everything should work correctly. We will be redirected to a confirm page, if we choose yes, client will obtain a pair of access token and secret.

    02_oauth_client.png 03_oauth_client_authorized.png

  7. Finally, if you visit http://localhost:8000 you can access the authorized data:


example-oauth2-server open issues Ask a question     (View All Issues)
  • over 3 years /oauth/authorize redirects to /oauth/errors (argument of type 'NoneType' is not iterable)
  • almost 5 years TypeError: sequence index must be integer, not 'str'
  • about 5 years "invalid_grant", when request "/oauth/token........"
  • over 5 years Authentication via a JavaScript client without CLIENT_SECRET ?
  • over 5 years "But it could be better, if you implemented"
  • almost 6 years tokengetter method is not used
example-oauth2-server open pull requests (View All Pulls)
  • Return data for a good response - otherwise show error
  • Automatic redirection from user login
  • Add client_credential flow clients
  • Add three screenshots to explain what happens in the database when
  • add a MongoDB example
  • adds tests that run without a client server
example-oauth2-server list of languages used
Other projects in Python