代码之家  ›  专栏  ›  技术社区  ›  Ned Ryerson

使用ASP进行外部身份验证。NET Web API 2-Microsoft现在不工作

  •  0
  • Ned Ryerson  · 技术社区  · 8 年前

    this one

    我遇到的第一个错误是-

    错误=拒绝访问 HTTP/1.1“302 0” https://login.live.com/oauth20_authorize.srf?client_id=0000000

    我在上删除了应用程序 https://apps.dev.microsoft.com 考虑重新添加它可能会解决问题,发现我无法以这样的方式重新添加它以生成客户ID&客户机密。微软对OAuth的支持完全改变了吗?现在我该怎么办?

    下面是Startup类的一部分,展示了我如何配置Facebook&Microsoft OAuth。

    public partial class Startup
    {
        public static OAuthAuthorizationServerOptions OAuthOptions { g
    
        // For more information on configuring authentication, please 
        public void ConfigureAuth(IAppBuilder app)
        {
            // working 
            var fbook = new FacebookAuthenticationOptions
            {
                AppId = "sadfsda",
                AppSecret = "dsfsadf"
            };
            app.UseFacebookAuthentication(fbook);
    
            // not working
            var msoft = new MicrosoftAccountAuthenticationOptions
            {
                ClientId = "sadf",
                ClientSecret = "zdfsdf",
            };
            app.UseMicrosoftAccountAuthentication(msoft);
    
    1 回复  |  直到 8 年前
        1
  •  0
  •   Ned Ryerson    8 年前

    在阅读了GitHub链接的一些评论后,我能够修复这个问题。我在上创建了一个新应用程序 https://apps.dev.microsoft.com 生成新密码 按钮这和我用于ClientId和ClientSecret的应用程序Id(guid)。添加了重定向URL,例如。

    https://www.sadfsdaf.com/signin-microsoft 
    

    推荐文章