def ValidateAuthTokenServer(self, token):
    if not self.GetNonce(token.nonce):
      # Nonce was not generated before!
      return False
    if token.username != self.server_username:
      # Invalid username.
      return False
    generated_hash = self._GenerateAuthHash(token.nonce, self.server_username,
                                            self.server_password)
    return token.hash == generated_hash
Check if a given token has valid server credentials.
dataset/ETHPy150Open google/grr/grr/server/data_server/auth.py/NonceStore.ValidateAuthTokenServer