API を使用してアプリケーションを認証しようとしています。
方法は次のとおりです。
- を使用して URL を開いています
webbrowser.open
。 - ユーザーはアプリケーションを認証し、
https://stackexchange.com/oauth/login_success
この URL でエンコードされた引数を持つ別の URL にリダイレクトされます。
サンプルのリダイレクト URL は次のとおりです。
.../login_success#access_token=xyz&expires=00000
私の現在のコード:
auth_url = 'https://stackexchange.com/oauth/dialog'
def authenticate():
scope = "write_access,private_info,read_inbox"
url = make_url(auth_url,client_id=132,
scope=scope,response_type='code',
redirect_uri='https://stackexchange.com/oauth/login_success')
webbrowser.open(url)
ユーザーが自分自身を認証した後、リダイレクト URL (ユーザーが移動する URL) を取得するにはどうすればよいですか?