There has been quite a few discussions about a password control in InfoPath.
Microsoft's issue is that it doesn't make sense because the values are stored in plain text anyway--of course this doesn't account for the reality that you could bind the control to a secondary data source (which is not stored).
One solution is to create a task pane. Since this is HTML, you can do whatever you want. Your user would login (or whatever) in the task pane, which could then switch views (or whatever).