I was able to resolve the 401 error, turned out to be a basic mistake from my side of providing the incorrect credentials. Closing issue