from rest_framework.authentication import BaseAuthentication
class OAuth2ClientCredentialsAuthentication(BaseAuthentication):
def authenticate(self, request):
# get token, get username
# send token to Oauth server
# if token is authorized, login user
return (user, None)