This plugin allows you to password protect acces to your application, it allows your users to register a password. and whenever you want you can ask them to enter it so you can restrict access to the app or other parts.
Its very easy to use, with this purchase a sample project and a instruction page is included.