ASP.Net MVC6支持OAuth 2承载令牌吗?能否详细解释其实现机制和优势?
- 内容介绍
- 文章标签
- 相关推荐
本文共计324个文字,预计阅读时间需要2分钟。
我正在使用ASP.Net MVC6开发一个应用,想使用bearer令牌实现OAuth 2.0认证。关于这是否可行,我找不到可靠的信息。有人能指出我正确的方向吗?感谢!
我正在使用ASP.Net MVC6开发一个应用程序,我想使用bearer令牌实现OAuth 2 auth.关于这是否可行,我找不到任何可靠的信息.有人能指出我正确的方向吗? TL; DR:Microsoft为ASP.NET Core开发的官方软件包仅支持OAuth2承载令牌验证.这意味着…
> …您将能够使用外部身份提供商(如Azure Active Directory)使用Microsoft.AspNetCore.Authentication.JwtBearer包发出的承载令牌对您的用户进行身份验证:
app.UseJwtBearerAuthentication(new JwtBearerOptions { AutomaticAuthentication = true, Audience = "localhost:50000/", // Authority is only useful if your JWT tokens // are issued by an OpenID Connect server. Authority = "[OpenID Connect provider address]", // If you don't use an OpenID Connect server, you have to manually update the // token validation parameters with the issuer's signing key. TokenValidationParameters = new TokenValidationParameters { IssuerSigningKey = new X509SecurityKey(certificate) } });
也就是说,现在只支持JWT令牌OTB:与Katana 3一起提供的OAuth2承载中间件本身支持OAuth2授权服务器生成的不透明令牌,但此支持已被删除.
> …你将无法生产自己的代币. OAuth2授权服务器已被删除,不会移植到ASP.NET Core:OAuth Authorization Service in ASP.NET Core.
幸运的是,存在替代方案.我个人正在开发一个基于Katana附带的OAuth2服务器的OpenID Connect服务器中间件,它提供相同的低级别体验:github.com/aspnet-contrib/AspNet.Security.OpenIdConnect.Server
有关更多信息,您可以查看此SO答案:Configure the authorization server endpoint
本文共计324个文字,预计阅读时间需要2分钟。
我正在使用ASP.Net MVC6开发一个应用,想使用bearer令牌实现OAuth 2.0认证。关于这是否可行,我找不到可靠的信息。有人能指出我正确的方向吗?感谢!
我正在使用ASP.Net MVC6开发一个应用程序,我想使用bearer令牌实现OAuth 2 auth.关于这是否可行,我找不到任何可靠的信息.有人能指出我正确的方向吗? TL; DR:Microsoft为ASP.NET Core开发的官方软件包仅支持OAuth2承载令牌验证.这意味着…
> …您将能够使用外部身份提供商(如Azure Active Directory)使用Microsoft.AspNetCore.Authentication.JwtBearer包发出的承载令牌对您的用户进行身份验证:
app.UseJwtBearerAuthentication(new JwtBearerOptions { AutomaticAuthentication = true, Audience = "localhost:50000/", // Authority is only useful if your JWT tokens // are issued by an OpenID Connect server. Authority = "[OpenID Connect provider address]", // If you don't use an OpenID Connect server, you have to manually update the // token validation parameters with the issuer's signing key. TokenValidationParameters = new TokenValidationParameters { IssuerSigningKey = new X509SecurityKey(certificate) } });
也就是说,现在只支持JWT令牌OTB:与Katana 3一起提供的OAuth2承载中间件本身支持OAuth2授权服务器生成的不透明令牌,但此支持已被删除.
> …你将无法生产自己的代币. OAuth2授权服务器已被删除,不会移植到ASP.NET Core:OAuth Authorization Service in ASP.NET Core.
幸运的是,存在替代方案.我个人正在开发一个基于Katana附带的OAuth2服务器的OpenID Connect服务器中间件,它提供相同的低级别体验:github.com/aspnet-contrib/AspNet.Security.OpenIdConnect.Server
有关更多信息,您可以查看此SO答案:Configure the authorization server endpoint

