Hi Phuong,
If a non-existing user tries to authenticate, and you capture that event, you can create the user with the User API (~\CMS\CMSAPIExamples\Code\Administration\Membership) which will ensure the user is added to the database. Is that what you had in mind?
Best Regards,
Sandro