There isn't any API for iMessage as far as I know, collecting username and password was the only way to do it. It's a lot like many Twitter apps nowadays just ask for username and password since the Twitter API, which is needed for oauth/xauth, is pretty locked down and useless nowadays.