Currently, I use HTTP Basic Authentication in the script to login to the SharePoint site and then retrieve my data.
To avoid storing username/password in the script, I looked at using OAuth in the script. If I understand correctly, I have to authorize the script to access the REST API by supplying it the Access Token.
Is my approach correct? If yes, how can I obtain the access token (and by extension, the refresh token)?
It seems like most of the tutorials talk about accessing an App that requires authorization, but in my case it is my script.