{'status': 401, 'message': 'invalid csrf token'} When trying to authorize through Python Script

like this example

https://barrycarlyon.github.io/twitch_misc/authentication/implicit_auth/

a webpage or HTTP intercerptor is expected to capture the token from the URL.

Or using a webpage like this you get the user to copy/paste their token from this external tool and paste into your tool.