Using pin or password to authenticate users

Hi pls can someone direct me to a resource on how to use password or pin to authenticate users.
my use case, i want to allow users on the web to use password and those using ussd to access the application to use pin. need help with this. thanks