PDIO-230 Refactor sigin and auth and add test