The single photon quantum identity authentication protocol does not require any source of entangled photons, which saves quantum resources to some extent. Existing studies have demonstrated the security of single-photon quantum identity authentication protocols in 2-dimensional quantum systems under CNOT attack. In this paper, based on the CNOT gate of the odd-prime dimensional computational basis and its phase kickback, we proved that the output result of the d-dimension CNOT gate, that is, when we choose the vector in the first group of mutually unbiased basis as the target bit, the control bit changes, and when we choose any vector in the remaining d-1 group of mutually unbiased basis as the target bit, an entangled state is generated. Based on this output, the article proposed a quantum identity authentication protocol in odd prime dimensional quantum system, which can verify the identity of the two parties without revealing the pre-shared key authenticated by the communicating parties and can detect the presence of the adversary using a randomly generated key. In d-dimensional protocol, the higher the number of qubits chose by communicating parties, the higher the success probability of protocol. Security analysis indicates that the protocol can resist impersonation attack, interception measure-resend attack, entanglement measurement attack, and CNOT attack.