"通用"在OpenID的ASP.NET MVC 5 [英] "Generic" OpenID in ASP.NET MVC 5

查看:172
本文介绍了"通用"在OpenID的ASP.NET MVC 5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ASP.NET MVC 5新的身份验证功能发挥各地(I previously使用 DotNetOpenAuth )。

I played around with the new authentication features in ASP.NET MVC 5 (I previously used DotNetOpenAuth).

据我了解,内置谷歌提供使用OpenID [1](和正常工作),但我想用我自己的OpenID提供商进行身份验证时。

I understand that the built-in Google provider uses OpenID [1] (and it works fine), but I want to use my own OpenID provider when authenticating.

不幸的是,我没能找到一个简单的方法在ASP.NET MVC 5的外装即用功能,我经历了 Microsoft.Owin的来源看,以实现这一目标。 Security.Google ,并在此基础上,似乎很可能增加一个新的OpenID提供商。

Unfortunately, I was not able to find an easy way to accomplish this with the out-of-the-box features of ASP.NET MVC 5. I looked through the source of Microsoft.Owin.Security.Google and based on this it seems quite possible to add a new OpenID provider.

时有更简单的(也许已经内置)的方式来一个新的OpenID提供者添加到ASP.NET MVC 5应用程序?或者,我必须从头写一个(新的Owin中间件)?

Is there an easier (maybe already built-in) way to add a new OpenID provider to an ASP.NET MVC 5 application? Or do I have to write one from scratch (a new Owin middleware)?

[1] <一个href=\"http://www.asp.net/mvc/tutorials/mvc-5/create-an-aspnet-mvc-5-app-with-facebook-and-google-oauth2-and-openid-sign-on\">http://www.asp.net/mvc/tutorials/mvc-5/create-an-aspnet-mvc-5-app-with-facebook-and-google-oauth2-and-openid-sign-on

[2] <一个href=\"http://www.symbolsource.org/MyGet/Metadata/aspnetwebstacknightly/Project/Microsoft.Owin.Security.Google/2.0.1-rtw1-20924-641-dev/Release/.NETFramework,Version=v4.5/Microsoft.Owin.Security.Google\">http://www.symbolsource.org/MyGet/Metadata/aspnetwebstacknightly/Project/Microsoft.Owin.Security.Google/2.0.1-rtw1-20924-641-dev/Release/.NETFramework,Version=v4.5/Microsoft.Owin.Security.Google

推荐答案

我在同样的情况,我认为答案是不。

I'm in the same situation and I think the answer is "no."

关键类是Microsoft.Owin.Security.Google.GoogleAuthenticationHandler实现OWIN后台处理程序。这是硬编码调用出来 https://www.google.com/accounts/o8/ud 在其AuthenticateCoreAsync以及硬编码在ApplyResponseChallengeAsync的属性交换请求。如果有更好的办法(即一个OpenID基类),我假设他们肯定会代替它硬编码这两个点。我假设微软并未使它通用由于档期原因或认为需求不足。

The key class is Microsoft.Owin.Security.Google.GoogleAuthenticationHandler that implements the OWIN backend handler. It's hard coding the call out to https://www.google.com/accounts/o8/ud in its AuthenticateCoreAsync as well as hard coding the Attribute eXchange request in ApplyResponseChallengeAsync. If there was a better way (i.e. an OpenID base class), I'm assuming they surely would have used it instead of hard coding these two spots. I'm assuming Microsoft didn't make it generic due to schedule reasons or perceived lack of demand.

我觉得一个开源的通用的OpenID OWIN中间件将是一个伟大的NuGet包。

I think an open source generic OpenID OWIN middleware would be a great NuGet package.

这篇关于&QUOT;通用&QUOT;在OpenID的ASP.NET MVC 5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆