The interaction of ultra-high-energy cosmic rays (UHECRs) with pervasive photon fields generates associated cosmogenic fluxes of neutrinos and photons due to photohadronic and photonuclear processes taking place in the intergalactic medium. We perform a fit of the UHECR spectrum and composition measured by the Pierre Auger Observatory for four source emissivity scenarios: power-law redshift dependence with one free parameter, active galactic nuclei, gamma-ray bursts, and star formation history. We show that negative source emissivity evolution is favoured if we treat the source evolution as a free parameter. In all cases, the best fit is obtained for relatively hard spectral indices and low maximal rigidities, for compositions at injection dominated by intermediate nuclei (nitrogen and silicon groups). In light of these results, we calculate the associated fluxes of neutrinos and photons. Finally, we discuss the prospects for the future generation of high-energy neutrino and gamma-ray observatories to constrain the sources of UHECRs. understood, the prospects for ultra-high-energy cosmic-ray astronomy are unclear (see e.g. Refs. [6][7][8]).The so-called dip model [9, 10] postulates a purely protonic composition for the UHECR flux and was once the prevalent paradigm. However, many pure proton models have been disfavoured due to the fact that they overproduce the diffuse gamma-ray background (DGRB) [11][12][13][14][15] and/or violate neutrino limits [16][17][18]. Because protons tend to contribute to the overall cosmogenic fluxes considerably more than other nuclei, even in a mixed-composition scenario it is possible to set limits on the total fraction of protons arriving at Earth based on the associated cosmogenic fluxes [19,20]. In recent years, much effort has been put into this kind of study [21][22][23].Recently the Pierre Auger Collaboration has performed a combined spectrum-composition fit [24]. A number of simplified assumptions are made in this work, namely that the sources are uniformly distributed within the comoving volume and that only five nuclear species are emitted (H, He, N, Si, and Fe), being these five species a representative sample that can approximately describe reality. The extragalactic magnetic field is assumed to be null. It was also attempted to account for theoretical uncertainties related to the modelling of propagation and cross check results of two simulations codes, photonuclear cross sections, and models of the EBL.The results of the Auger fit are rather surprising, pointing to a "hard-spectrum problem", favouring low spectral indices (α 1), and posing challenges to the current acceleration paradigm. The situation can be alleviated by making a distinction between the spectrum of the accelerated particles (α acc ) and the one of the escaping particles (α esc ), since interactions with the gas and photons surrounding a source and the local magnetic fields can drastically change the spectral shape. In the following discussion, unless otherwise stated, we will refer to the escape spectr...