Added basic code to handle logging in with custom UI.