extract auth_client to gem