Skip to content

factorysh/aiohttp-oauth2-gitlab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AIOhttp OAuth2 Gitlab demo

Authenticate aiohttp application with a middleware and Gitlab.

You need :

from aiohttp import web

app = web.Application()
# now, add a session middleware
# ...

# then, add the aioauth gitlab middleware
add_gitlab_oauth(
app, client_id=client_id, client_secret=client_secret, base_url=base_url
)

Example

Add an application to your Gitlab, with just read_user.

Set few environments vars : GITLAB_ID, GITLAB_SECRET, GITLAB_URL

python3 -m venv venv
./venv/bin/activate
pip install .
python example/server.py

Go to http://localhost:5000

Licence

3 terms BSD licence, ©2019 Mathieu Lecarme

Releases

No releases published

Packages

No packages published

Languages