Someone introduced himself to us.

After that, when we look back and say what he said, which is right to say?

> 
> What did he say his name is?
> 
> 
> What did he say his name was?
> 
> 
> 

I think the first one is plausible because his name is always XX, but I'm not sure. Please tell me which is allowed.