code: def authenticate(self, provider=None, identifier=None):
          "Fetch user for a given provider by id."
          provider_q = Q(provider__name=provider)
          if isinstance(provider, Provider):
              provider_q = Q(provider=provider)
          try:
              access = AccountAccess.objects.filter(
                  provider_q, identifier=identifier
              ).select_related('user')[0]
          except IndexError:
              return None
          else:
              return access.usef authenticate(self, provider=None, identifier=None):
          "Fetch user for a given provider by id."
          provider_q = Q(provider__name=provider)
          if isinstance(provider, Provider):
              provider_q = Q(provider=provider)
          try:
              access = AccountAccess.objects.filter(
                  provider_q, identifier=identifier
              ).select_related('user')[0]
          except IndexError:
              return None
          else:
              return access.user
docs: Fetch user for a given provider by id.