Require Keycloak custom login api using username and 6-digit PIN credential

I would suggest that you do yourself a favor and just use the already available OTP password support, see Server Administration Guide and Server Administration Guide