version with client-side auth logics inside of ruby script