Oauth requires a HubSpot user to log in and click the grant access button, after which you’d get a code that can be used to get the access token and refresh token. If you provide the refresh token to your script, it would be able to get access_tokens to access the APIs going forward.