我不明白这是如何工作的:
from flask import Flask, redirect
oauth_uri = 'https://accounts.freelancer.com/oauth/authorise'
client_id = '<CLIENT_ID>'
redirect_uri = '<CLIENT_REDIRECT_URI>'
prompt = 'select_account consent'
advanced_scopes = '1 3'
app = Flask(__name__)
# Users who hit this endpoint will be redirected to the authorisation prompt
@app.route('/authorize')
def handle_authorize():
return redirect(
'{0}?response_type=code'
'&client_id={1}&redirect_uri={2}'
'&scope=basic&prompt={3}'
'&advanced_scopes={4}'.format(
oauth_uri, client_id, redirect_uri, prompt, advanced_scopes
)
)
此代码为我提供:浏览器中的无效重定向URI。这是什么重定向的URI,为什么我不能给我选择的任何重定向uri?它在此处记录:任何人都可以向我解释一下这是如何工作的,https://developers.freelancer.com/docs/authentication/generation-access-tokens#header-receive-receive-authorisation-response-response
重定向URL是您在应用程序仪表板上设置的应用程序的URL。您需要为Freelancer.com指定有效的URL,以重定向到用户授予应用程序访问权限后。考虑Facebook如何使用其在系统中的日志授予第三方应用程序访问。