#8 simplified getLoginUrl to support different types