Implement AutoLogin to generate/retrieve codes using a RestTemplate that automatically fetches a token

Finish implementation of https://www.pivotaltracker.com/story/show/57817784