PLINK-165: migrate eric whittman's login module for REST/SAML bearer token