allow clientId and clientSecret to be passed as functions