-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlinuxdo.py
More file actions
25 lines (20 loc) · 895 Bytes
/
linuxdo.py
File metadata and controls
25 lines (20 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from fastapi_oauth20.oauth20 import OAuth20Base
class LinuxDoOAuth20(OAuth20Base):
"""Linux.do OAuth2 client implementation."""
def __init__(self, client_id: str, client_secret: str):
"""
Initialize Linux.do OAuth2 client.
:param client_id: Linux.do OAuth application client ID.
:param client_secret: Linux.do OAuth application client secret.
"""
super().__init__(
client_id=client_id,
client_secret=client_secret,
authorize_endpoint='https://connect.linux.do/oauth2/authorize',
access_token_endpoint='https://connect.linux.do/oauth2/token',
refresh_token_endpoint='https://connect.linux.do/oauth2/token',
userinfo_endpoint='https://connect.linux.do/api/user',
token_endpoint_basic_auth=True,
)