Can I get my web site to programmatically log in to obtain API Token/RefreshToken?

P.S. Your ‘fallback’ suggestion is not a bad idea.