Added an application field to the pin

Also, if the username is left blank then it will be set to the
application field value