小编use*_*738的帖子

我得到"此请求已被拒绝授权." 使用OWIN oAuth中间件(具有单独的Auth和资源服务器)时出现错误消息

我试图解耦我的身份验证和资源服务器.我按照本教程中提供的示例进行操作:

http://bitoftech.net/2014/09/24/decouple-owin-authorization-server-resource-server-oauth-2-0-web-api/

这是我的auth服务器中的Startup.cs中的代码:

using Microsoft.Owin;
using Microsoft.Owin.Security.OAuth;
using Owin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AuthServer.Web
{
   public class Startup
   {
      public void Configuration(IAppBuilder app) {
         ConfigureOAuth(app);
      }

      public void ConfigureOAuth(IAppBuilder app)
      {
         OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions()
         {
            AllowInsecureHttp = true,
            TokenEndpointPath = new PathString("/token"),
            AccessTokenExpireTimeSpan = TimeSpan.FromDays(1),
            Provider = new SimpleAuthorizationServerProvider()
         };

         // Token Generation
         app.UseOAuthAuthorizationServer(OAuthServerOptions);
         app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions());

      }
   }
}
Run Code Online (Sandbox Code Playgroud)

这是我的资源服务器中的startup.cs(即我的示例Web api应用程序):

using Microsoft.Owin.Security.OAuth;
using Owin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web; …
Run Code Online (Sandbox Code Playgroud)

asp.net oauth oauth-2.0 asp.net-web-api owin

23
推荐指数
3
解决办法
6万
查看次数

如何使用ASP.NET标识设置Thinktecture Identity Server v3 beta 1-2?

我已经查看了Thinktecture Identity Server v3的所有文档,并且无法弄清楚如何开始使用ASP.NET标识.

有人可以从第1步(即克隆git repo)一步一步地向高级别解释它的最终状态,该状态也是由Identity Manager启动并运行的.基本上我只需要知道如何设置它.

我在Vimeo上看到的视频似乎已经过时了(我可能错了,因为我是新手)因为现在有几个存储库,在视频中我认为我在同一个核心解决方案中看到了asp.net身份用户服务.

我正在尝试为我的雇主(AngularJS,Identity Server,OAuth 2.0,资源所有者与隐式流程)对此进行原型设计,并希望尽快使其正常运行.

提前谢谢了!安德鲁

oauth-2.0 asp.net-web-api thinktecture-ident-server asp.net-identity

5
推荐指数
1
解决办法
3784
查看次数