【发布时间】:2015-03-25 19:01:25
【问题描述】:
我使用 VS2013 中提供的标准模板创建了一个新的 WebForms 应用程序。我需要将 Microsoft 身份验证集成到其中。在浏览了许多教程/博客后,我终于..
- 在 Azure 上托管了我的 webapp。
- 注册我的应用程序
account.live.com/developers/ 并获得了 Client ID 和 Secret。在该门户上,我已将 redirect_uri 设置为
http://myxyzapp.azurewebsites.net/signin-microsoft -
我已将 AuthConfig.cs 更新为..
public static void RegisterOpenAuth() { OpenAuth.AuthenticationClients.AddMicrosoft( clientId: "----MyClientID----",clientSecret: "----MyClientSecret----"); }
但是,当我运行应用程序并输入我的 Microsoft 凭据登录时,我收到错误消息:Microsoft 帐户遇到技术问题。请稍后再试。
响应头说: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.
有人可以指导我在哪里指定这个 redirect_uri 吗?我在 SO 和其他论坛上经历了许多类似的问题,但没有得到任何涉及 WebForms 和 Microsoft OAuth2 的具体答案。
【问题讨论】:
标签: c# asp.net webforms oauth-2.0 .net-4.5