首页 \ 问答 \ 错误:redirect_uri_mismatch :: redirect_uri必须匹配注册的回调URL(error : redirect_uri_mismatch :: The redirect_uri MUST match the registered callback URL)

错误:redirect_uri_mismatch :: redirect_uri必须匹配注册的回调URL(error : redirect_uri_mismatch :: The redirect_uri MUST match the registered callback URL)

所以我正在尝试使用Github OAuth API在Flask中学习OAuth,并且我正在使用flask_dance库。 我能够在Github上对自己进行身份验证,然后返回到我的应用程序,但显示404 Not Found Error和url中的http://localhost:5000/login/authorized?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application... ,回调网址似乎是正确的,因为它是我在github上给出的,但仍然显示redirect_uri mismatch 。 我在这里阅读文档并知道我们可以从请求中删除redirect_uri参数,但我不知道该怎么做。 (我在Windows 10上)
你能帮忙的话,我会很高兴。 谢谢。

显示在这里

App.py

from flask import Flask, redirect, url_for
from werkzeug.contrib.fixers import ProxyFix
from flask_dance.contrib.github import make_github_blueprint, github

app = Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app)
app.secret_key = "supersekrit"
blueprint = make_github_blueprint(
    client_id="xxxxxxxxx",
    client_secret="xxxxxxxx",
)
app.register_blueprint(blueprint, url_prefix="/login")

@app.route("/signup")
def index():
    if not github.authorized:
        return redirect(url_for("github.login"))
    resp = github.get("/user")
    assert resp.ok
    return "You are @{login} on GitHub".format(login=resp.json()["login"])

if __name__ == "__main__":
    app.run(debug=True)

So I am trying to learn OAuth in Flask using Github OAuth API and I am using flask_dance library for it. I am able to authenticate myself on Github and return back to my app but in its showing 404 Not Found Error and in the url its http://localhost:5000/login/authorized?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application... , The callback url seems correct as it is what I gave on github but still its showing redirect_uri mismatch . I was reading the documentation here and got to know that we can remove redirect_uri parameter from the request but I am not sure how to do that. ( and I am on Windows 10 )
Any help would be nice. Thanks.

shown here

App.py

from flask import Flask, redirect, url_for
from werkzeug.contrib.fixers import ProxyFix
from flask_dance.contrib.github import make_github_blueprint, github

app = Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app)
app.secret_key = "supersekrit"
blueprint = make_github_blueprint(
    client_id="xxxxxxxxx",
    client_secret="xxxxxxxx",
)
app.register_blueprint(blueprint, url_prefix="/login")

@app.route("/signup")
def index():
    if not github.authorized:
        return redirect(url_for("github.login"))
    resp = github.get("/user")
    assert resp.ok
    return "You are @{login} on GitHub".format(login=resp.json()["login"])

if __name__ == "__main__":
    app.run(debug=True)

原文:https://stackoverflow.com/questions/49592599
更新时间:2022-04-24 11:04

最满意答案

假设您的第一个查询返回单个结果,那么这应该工作:

DELETE p 
FROM possessions p
    INNER JOIN goods_meta_data gmd ON p.good_id = gmd.id
    INNER JOIN cities c ON c.name = 'St Charles'
WHERE p.day_created < c.day - gmd.durability 

Assuming your first query returns a single result, then this should work:

DELETE p 
FROM possessions p
    INNER JOIN goods_meta_data gmd ON p.good_id = gmd.id
    INNER JOIN cities c ON c.name = 'St Charles'
WHERE p.day_created < c.day - gmd.durability 

相关问答

更多
  • 用JOIN子句替换你的嵌套选择。 以此为例: AND a.FundIDRecv IN ( SELECT FundIDRecv FROM tbl_FundSubscriptions WHERE FundIDSend IN ( SELECT FundID FROM tbl_FundStatic WHERE UserID = '14' ) ) 为什么不把tbl_FundStatic连接到这样的外部查询呢? FROM tbl_Fund ...
  • 尝试更改最后一条语句,因为查询将评估所有这些语句。 然后检查是否等于1,你应该尝试和“OR”语句,因为如果一个是正确的,它就不会评估其他的选择。 它应该会对你有所帮助。 像这样的东西。 AND ( SUBSTRING(s."Field ID" FROM 0 FOR 3) = '01' OR SUBSTRING(s."Field ID" FROM 0 FOR 4) = '321' OR SUBSTRING(s."Field ID" FROM 0 FOR 5) = '1234' OR S ...
  • 如果你不能改变表格(存储单独的日期会有所帮助),那么只有索引,那么: 创建一个复合索引: carrier, reg_date ,然后组合carrier, reg_date和order by reg_date, carrier 。 您可以为时间戳创建另一个索引(它可能对WHERE caluse更好,取决于范围之外的记录数)。 此外,您可以使用完全unix时间戳,然后将其作为子查询嵌入,外部可将时间戳转换为人类可读的日期(这种转换是在群组之后完成的,而不是针对每个单独的记录)。 创建索引: CREATE IND ...
  • 重复数据并非“糟糕”,并且不应“不惜一切代价”。 什么是“坏”是不受控制的冗余,以及当逻辑数据模型不是第三范式时出现的问题。 可以接受并预期实现将偏离逻辑数据模型,并为性能引入冗余。 您修改后的设计看起来适合您的需求。 Duplicated data is not "bad", and it's not to be "avoided at all cost". What is "bad" is uncontrolled redundancy, and the kind of problems that co ...
  • 可以查询多个IP地址。 我们可以采取几种方法。 假设range_start和range_end被定义为整数类型。 对于合理数量的ip地址,我们可以使用内联视图: SELECT i.ip, a.* FROM ( SELECT 3232235520 AS ip UNION ALL SELECT 3232235521 UNION ALL SELECT 3232235522 UNION ALL SELECT 3232235523 ...
  • 要尝试的事情: 有一个单独的date列(索引)并使用它而不是您的timestamp列 在type和date之间添加索引 使用BETWEEN(不要认为它会影响速度,但它更容易阅读) 理想情况下你会这么做 创建一个date列并使用UPDATE table SET date = DATE(timestamp)填充它UPDATE table SET date = DATE(timestamp) 跨type和date索引 将您的选择更改为... type =? 和约会? 和? Things to try: Have ...
  • 假设您的第一个查询返回单个结果,那么这应该工作: DELETE p FROM possessions p INNER JOIN goods_meta_data gmd ON p.good_id = gmd.id INNER JOIN cities c ON c.name = 'St Charles' WHERE p.day_created < c.day - gmd.durability Assuming your first query returns a single result ...
  • 我最终做的是混合了JRD,TZHX和MarcB的评论。 我最后做了一个没有时区的选择,但是增加了我的选择半径加减一天。 这让我的大约500万行下降到大约50,但是因为它比我想要的稍微多一点,然后我运行原始查询,但只对第一个选择返回的50个结果。 这导致返回所有完全相同的数据,但仅在0.11秒内。 非常感谢你们! What I ended up doing was a mix of JRD, TZHX, and MarcB's comments. I ended up doing a select witho ...
  • 假设你没有为coloumns建立索引,所以我为你的coloumns创建了一些索引,这对你有帮助,并且仍有很多coloumns索引,就像在你的连接条件中你应该对该coloumns应用这个操作也是为了更好的执行 ALTER TABLE `t_mmrrc_order` ADD INDEX `Indexnamemmrrc_order_oid` (`mmrrc_order_oid`); ALTER TABLE `t_mmrrc_order` ADD INDEX `Indexnamecompleted_by_email ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。