In Portal registration form I need to add two custom fields
- Date of Birth
- SSN Number
Note :- I have added two fields using content Snippet also added fields on contact database.

Now, I want to restrict users from creating duplicate records of Date of Birth and SSN Number.
If a user is trying to insert an "SSN" and "Date Of Birth" which already exists in the database, then to show a message pop up “User already register”. This is my requirement.
To achieve this,I have tried using an alternate key applied on two fields but I don’t want to use it as it's a direct operation on the database side.
Can you please suggest the best approach to handle the above requirement?
Also, can I handle using plugins? If the answer is Yes, How can plugin run on the register button of the portal page.
Regards,
Pauravi