def METHOD_NAME(self, request, *args, **kwargs):
    if "error" in request.GET or "code" not in request.GET:
        # Distinguish cancel from error
        auth_error = request.GET.get("error", None)
        if auth_error == self.adapter.login_cancelled_error:
            error = AuthError.CANCELLED
        else:
            error = AuthError.UNKNOWN
        return render_authentication_error(
            request, self.adapter.provider_id, error=error
        )
    app = self.adapter.get_provider().app
    client = self.get_client(self.request, app)
    try:
        access_token = self.adapter.get_access_token_data(request, app, client)
        token = self.adapter.parse_token(access_token)
        if app.pk:
            token.app = app
        login = self.adapter.complete_login(
            request, app, token, response=access_token
        )
        login.token = token
        if self.adapter.supports_state:
            login.state = SocialLogin.verify_and_unstash_state(
                request, get_request_param(request, "state")
            )
        else:
            login.state = SocialLogin.unstash_state(request)
        return complete_social_login(request, login)
    except (
        PermissionDenied,
        OAuth2Error,
        RequestException,
        ProviderException,
    ) as e:
        return render_authentication_error(
            request, self.adapter.provider_id, exception=e
        )