services.py 908 Bytes
Newer Older
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 26 27 28 29 30 31 32 33 34 35 36
""" Taken from https://github.com/maraujop/requests-oauth2 """

from . import OAuth2


class GoogleClient(OAuth2):
    """Google oauth2"""
    site = "https://accounts.google.com"
    authorization_url = "/o/oauth2/auth"
    token_url = "/o/oauth2/token"
    scope_sep = " "


class FacebookClient(OAuth2):
    """Facebook oauth2"""
    site = "https://www.facebook.com/"
    authorization_url = "/dialog/oauth"
    token_url = "/oauth/access_token"
    scope_sep = " "


class InstagramClient(OAuth2):
    """Instagram oauth2"""
    site = "https://api.instagram.com"
    authorization_url = "/oauth/authorize"
    token_url = "/oauth/access_token"
    scope_sep = " "


class EurecomGitLabClient(OAuth2):
    """GitLab oauth2"""
    site = "https://gitlab.eurecom.fr"
    authorization_url = "/oauth/authorize"
    token_url = "/oauth/token"
    userinfo_url = site + '/oauth/userinfo'
    scope_sep = " "