Something is missing and I'm not sure what

That worked, thanks. It needed the cfgCon. But this is the ‘old’ method, is it not?
It doesn’t use the Oauth.

Is this secure?