I am trying to redirect a user to login with their patreon and to obtain the code needed to retrieve their access token by using the following code in python (flask framework):
auth_url = 'https://www.patreon.com/oauth2/authorize?response_type=code&client_id=' + client_id +'&redirect_uri=' + redirect_url
redirect(auth_url)
When I try this I am getting a CORS issue on the frontend.
So then I tried this instead:
auth_url = 'https://www.patreon.com/oauth2/authorize?response_type=code&client_id=' + client_id +'&redirect_uri=' + redirect_url
return(requests.get(auth_url, allow_redirects=True).text)
which gives me a Cloudflare challenge page (without the CAPTCHA visible, so its essentially unusable) instead of the Patreon login page when the html/css/javascript text that is returned is loaded in the browser.
Any help would be really appreciated, I understand the Patreon API does not support CORS client side, but the redirect (302) is occurring server side, so the first should work correct? And in case the first doesn’t work, why is the second one asking me to deal with a CAPTCHA challenge (which is not fully visible)?
Thanks for the help in advance!