Iis Can';t使用令牌进行身份验证

Iis Can';t使用令牌进行身份验证,iis,asp.net-mvc-4,azure,azure-web-roles,thinktecture-ident-model,Iis,Asp.net Mvc 4,Azure,Azure Web Roles,Thinktecture Ident Model,我有一个ASP.NETMVC网站,它使用ASP.NETWebAPI进行身份验证。我已经使用ThinkTecture IdentityModel进行了基本身份验证和会话令牌,这在本地和Azure网站中都可以正常工作。然而,我不得不迁移到Azure云服务,现在我无法使用令牌进行身份验证,总是收到401错误,但仅使用用户名和密码就可以了 我能猜到的唯一区别是我现在必须处理IIS。是否需要进行任何修改以允许使用令牌进行身份验证 更新: 我没有使用任何Web.Config配置进行身份验证,只是在WebAP

我有一个ASP.NETMVC网站,它使用ASP.NETWebAPI进行身份验证。我已经使用ThinkTecture IdentityModel进行了基本身份验证和会话令牌,这在本地和Azure网站中都可以正常工作。然而,我不得不迁移到Azure云服务,现在我无法使用令牌进行身份验证,总是收到401错误,但仅使用用户名和密码就可以了

我能猜到的唯一区别是我现在必须处理IIS。是否需要进行任何修改以允许使用令牌进行身份验证

更新:

我没有使用任何Web.Config配置进行身份验证,只是在WebAPIConfig中使用以下代码


public static void Register(HttpConfiguration config)
        {
            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );

            var authConfig = new AuthenticationConfiguration
                                 {
                                     RequireSsl = true,
                                     EnableSessionToken = true,
                                     SendWwwAuthenticateResponseHeaders = true,
                                     SessionToken = new SessionTokenConfiguration()
                                         {
                                             DefaultTokenLifetime = System.TimeSpan.FromDays(1.0)
                                         }
                                 };

            // setup authentication against membership
            authConfig.AddBasicAuthentication(
                (userName, password) => WebSecurity.Login(userName, password, true)
                );

            config.MessageHandlers.Add(new AuthenticationHandler(authConfig));
        }

我在SessionTokenConfiguration上设置了一个固定的签名密钥。您肯定需要它。

阅读本文以获得帮助,请提供您的web.confg的以下部分:
system.web\authentication
system.web\authentication
system.webserver\modules
system.identitymodel
system.identitymodel.services
@DaveA我没有使用Identity Server。我有一个需要身份验证的API,它正在使用Thinktecture.IdentityModel和WebMatrix.WebData.WebSecurity来验证每个请求。@astaykov我没有任何与这些元素相关的设置。我需要吗?您使用的是单个实例还是多个实例?谢谢,就像您所说的。