Added the code for setAuth and addAuth