'Authenticate the request for anyone or if a valid token is provided, a user.'

def authenticate(self, request):

    try:
        return TokenAuthentication.authenticate(TokenAuthentication(), request)
    except:
        return (AnonymousUser(), None)
