When you create a new project, if you choose the "Authorization" template, your application will have a built-in authorization mechanism (together with some additional features).
The log-in process itself looks like this:
Note that for security reasons it's important to have a single service that checks the password and performs "Set Logged-in User". A service that justs sets the logged-in user can allow any user to impersonate any other user.
For best results, use the Firefox browser..