Rewrite OAuth plugin