asp.net-identity – UseOAuthBearerTokens vs UseOAuthBearerAut
发布时间:2020-05-22 11:50:24 所属栏目:asp.Net 来源:互联网
导读:在我们的启动类中,我已经配置了以下认证服务器选项: OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions(){ AllowInsecureHttp = true, TokenEndpointPath = new PathString(/api/v1/tok
|
在我们的启动类中,我已经配置了以下认证服务器选项: OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions()
{
AllowInsecureHttp = true,TokenEndpointPath = new PathString("/api/v1/token"),AccessTokenExpireTimeSpan = TimeSpan.FromDays(1),Provider = new SimpleAuthorizationServerProvider()
};
在这之后,我们应该使用哪个选项来实际启用承载认证?互联网上似乎有两种变化。 选项1: app.USEOAuthAuthorizationServer(OAuthServerOptions); app.USEOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions()); 选项2: app.USEOAuthBearerTokens(OAuthServerOptions); 我已经测试过他们,两个结果是一样的。 这些选项之间有什么区别?我们什么时候应该使用? 解决方法USEOAuthBearerTokens扩展方法创建令牌服务器和中间件,以验证同一应用程序中的请求的令牌。使用反射器从源代码: USEOAuthAuthorizationServer(); // authorization server middleware USEOAuthBearerAuthentication(ApplicationOAuthBearerProvider); // application bearer token middleware USEOAuthBearerAuthentication(ExternalOAuthBearerProvider); // external bearer token middleware (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc – 在IIS 5.1上部署ASP.NET MVC(Windows XP)
- asp.net – 导致GridView无效回发的TemplateField按钮
- asp.net-web-api – 在WebApi和MVC项目之间共享SignalR集线
- asp.net – 禁用web.config继承?
- asp.net-mvc – Structuremap处理DataContext对象
- asp.net-mvc-2 – ASP.NET MVC数据注释客户端验证与继承的R
- ASP.NET Core 2.0 Web API响应缓存
- asp.net-mvc-3 – Paypal Sandbox MVC3
- asp.net-mvc – 在Html.ActionLink的linkText中使用HTML标签
- asp.net-mvc – MVC DB首先修复显示名称
推荐文章
站长推荐
- asp.net – 过程或函数“”需要参数“”,这是未提
- asp.net-mvc – 使用没有ORM的ASP.NET MVC
- 在提供页面之前确定ASP.NET页面视图状态的大小
- ASP.NET GridView CommandField作为TemplateFiel
- asp.net – Visual Studio 2010图表控件:使Y轴成
- asp.net-mvc – ASP.NET MVC5/IIS Express无法调
- asp.net-mvc – 如何构建一个企业MVC应用程序,业
- asp.net-core – 在执行DI时指定服务选项的干净方
- asp.net – 如何忽略正则表达式的情况?
- 获取ASP.NET中所有活动会话的列表
热点阅读
