Javascript file for oauth functions