gpt4 book ai didi

asp.net-mvc - asp.net MVC 站点重定向 uri 的实时 id 身份验证无效

转载 作者:行者123 更新时间:2023-12-01 08:57:32 25 4
gpt4 key购买 nike

我正在尝试在我的 asp.net Web 应用程序中使用实时 ID 身份验证。我按照以下帖子中的步骤进行操作

http://www.benday.com/2014/02/25/walkthrough-asp-net-mvc-identity-with-microsoft-account-authentication/

在本地主机中创建应用程序和设置域工作正常。在应用设置中设置重定向 url 是一个问题。当我运行应用程序时,它会提示错误

“为输入参数“redirect_uri”提供的值无效。期望值为'https://login.live.com/oauth20_desktop.srf ' 或与为此客户端应用程序注册的重定向 URI 匹配的 URL。"

我尝试了“http://www.mysampleapp.com/Account/ExternalLoginCallback”和“http://www.mysampleapp.com/signin-microsoft”。以及它不起作用的网址。 (mysampleapp 是我在本地托管的 url)

当我点击外部身份验证部分中的“Microsoft”时,我会被定向到以下网址

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

有什么办法可以查到网址吗?

最佳答案

如果您使用的是新的 Microsoft Live 应用程序设置然后重定向 URL:http://something.yourDomain.com/signin-microsoft

如果您使用的是旧版 Microsoft Live 应用程序设置然后重定向 URL:http://something.yourDomain.com/Account/ExternalLoginCallback

请注意:“某事”不应是 www。

不要使用www,用某种子域名替换它并在主机文件中正确设置。这就是我如何在我之前的项目中进行这项工作以在本地进行测试。

希望这会有所帮助。

关于asp.net-mvc - asp.net MVC 站点重定向 uri 的实时 id 身份验证无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25905626/

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