add client authorize function