Authentication fails when gnupg agent is communicating with pinentry-mac

I have solved the problem.

When using as auth for ssh, uif have to be set off for encryption and off for signing and just on for auth, otherwise it doesn’t work.