gpt4 book ai didi

asp.net-mvc - 使用默认的 ASP.Net MVC 设置,如何使用 Microsoft 帐户登录?

转载 作者:行者123 更新时间:2023-12-04 00:30:43 25 4
gpt4 key购买 nike

为什么我不断收到“输入参数‘redirect_uri’提供的值无效。”?

我的网站托管在 Azure 中。我正在尝试通过 Microsoft 登录按钮登录。我并没有对默认的 ASP.Net MVC 开箱即用模板进行太多更改。我真正所做的更改只是取消注释 app.UseMicrosoftAccountAuthentication 行并添加 clientIdclientSecret

我的重定向 URL 设置不正确吗?

Site: http://mysite.azurewebsites.net

Redirect URL: http://mysite.azurewebsites.net/

我在某处读到,您需要以 http://www.mysite.azurewebsites.net 的形式指定重定向 URL。谁能证实或否认这一点?我当前的设置中不需要 www

我一直收到的错误是:

https://login.live.com/err.srf?lc=1033#error=invalid_request&error_description=The provided value for the input parameter 'redirect_uri' is not valid. The expected value is 'https://login.live.com/oauth20_desktop.srf' or a URL which matches the redirect URI registered for this client application.&state=SomeLongPossiblyEncryptedString

此消息显示在尝试登录后返回的页面上:

微软帐户

我们无法完成您的请求

Microsoft 帐户遇到技术问题。请稍后重试。

2014 年 3 月 26 日更新:到目前为止还没有运气,这里有一些我的设置的屏幕截图,以防有帮助。基本信息

enter image description here

API 设置

enter image description here

这是 Microsoft 方面的问题还是我做错了什么?

最佳答案

从默认的 MVC 中,对我有用的重定向 URL(大约 5 分钟前刚刚测试过)是

http://testcrap.azurewebsites.net/ 登录微软

我找到的所有文档都说要使用

http://testcrap.azurewebsites.net/ 登录/微软帐户

但这对我不起作用......登录微软可以

enter image description here

或者,如果这不起作用,那么使用类似 firebug 的东西来查看对 oauth 提供者的请求是什么样子,然后无论该请求中的重定向URI是什么,都是您需要使用的..

enter image description here

关于asp.net-mvc - 使用默认的 ASP.Net MVC 设置,如何使用 Microsoft 帐户登录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22469263/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com