change oath2 plugin to be pure javascript