Does your app have a login page? If so then use Browser Based authentication - this will now handle dynamic login page URLs as long as it can find a login link on the URL you give it.