मुझे ओपन सोर्स प्रोजेक्ट में ओविन पैकेज अपग्रेड को डिबग करने में मुश्किल हो रही है। संक्षिप्त वर्णन यह है कि जब मैं v2.1 से अपग्रेड करता हूं, और डीबगिंग प्रक्रिया में बाहरी लॉग इन का उपयोग नए v3 संस्करण में टूट जाता है, तो मैं यह नहीं समझ सकता कि क्या अलग है। ध्यान रखें कि मेरा कोई भी कोड बदल नहीं गया है, मैं केवल ओविन घटक (माइक्रोसॉफ्ट.ऑविन और अन्य बच्चों के नामों में संकुल) को अद्यतन कर रहा हूं।2.1 से 3.0.1 तक OWIN को अपडेट करना बाहरी auth
यह इस फार्म पोस्ट के साथ शुरू होता है:
<form action="/Forums/Authorization/ExternalLogin?ReturnUrl=http%3A%2F%2Flocalhost%3A1973%2FForums" method="post"><input name="__RequestVerificationToken" type="hidden" value="--verificationtoken--" /> <h2>External Logins</h2>
<p>
<button type="submit" id="Google" name="provider" value="Google" class="btn btn-primary">Google</button>
</p>
</form>
यह इस पद्धति पर भी पोस्ट कर: https://github.com/POPWorldMedia/POPForums/blob/v13.0.0/PopForums/Controllers/AuthorizationController.cs
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult ExternalLogin(string provider, string returnUrl)
{
return new ChallengeResult(provider, Url.Action("ExternalLoginCallback", "Authorization", new { loginProvider = provider, ReturnUrl = returnUrl, area = "PopForums" }));
}
कॉलबैक भूमि यहाँ: दूसरी पंक्ति इस कॉल
public async Task<ActionResult> ExternalLoginCallback(string loginProvider, string returnUrl)
{
var authentication = _owinContext.Authentication;
var authResult = await _externalAuthentication.GetAuthenticationResult(authentication);
if (authResult == null)
return RedirectToAction("Login", "Account", new { error = Resources.ExpiredLogin });
...
public async Task<ExternalAuthenticationResult> GetAuthenticationResult(IAuthenticationManager authenticationManager)
{
var authResult = await authenticationManager.AuthenticateAsync(ExternalCookieName);
if (authResult == null)
return null;
...
AuthenticationManager IAuthenticationManager के कार्यान्वयन के किसी भी, गूगल, फेसबुक, आदि संकुल में हो सकता है। समस्या यह है कि वे सभी असफल हो जाते हैं और एक शून्य वस्तु वापस कर देते हैं, इसलिए ऐप उपयोगकर्ता को लॉगिन नहीं कर सकता है।
पुन: पेश करने के लिए:
- क्लोन v13 शाखा: https://github.com/POPWorldMedia/POPForums.git
- भागो एप्लिकेशन को स्थानीय रूप से निर्देशों के अनुसार: https://github.com/POPWorldMedia/POPForums/wiki/Documentation
- व्यवस्थापक में, बाहरी लॉगिन पेज चुनते हैं, और में से एक के लिए साख जोड़ने प्रदाताओं और बॉक्स की जांच करें।
- लॉगआउट, फिर नए प्रदाता के साथ लॉगिन करने के लिए बटन का उपयोग करें।
- इसे असफल देखें, और देखें कि उपर्युक्त बाहरी प्रमाणीकरण GetAuthenticationResult विधि शून्य है।
मैं सोच रहा हूं कि ओविन कॉन्फ़िगरेशन में कुछ बदल गया है जो मुझे समझ में नहीं आता है। रिकॉर्ड के लिए, यह यहां है: https://github.com/POPWorldMedia/POPForums/blob/v13.0.0/PopForums/Configuration/PopForumsOwinStartup.cs
using System;
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.Cookies;
using Owin;
using PopForums.ExternalLogin;
using PopForums.Services;
using PopForums.Web;
namespace PopForums.Configuration
{
public class PopForumsOwinStartup
{
public void Configuration(IAppBuilder app)
{
var setupService = PopForumsActivation.ServiceLocator.GetInstance<ISetupService>();
if (!setupService.IsDatabaseSetup())
return;
var settings = PopForumsActivation.ServiceLocator.GetInstance<ISettingsManager>().Current;
app.SetDefaultSignInAsAuthenticationType(ExternalAuthentication.ExternalCookieName);
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = ExternalAuthentication.ExternalCookieName,
AuthenticationMode = AuthenticationMode.Passive,
CookieName = CookieAuthenticationDefaults.CookiePrefix + ExternalAuthentication.ExternalCookieName,
ExpireTimeSpan = TimeSpan.FromMinutes(60)
});
if (settings.UseTwitterLogin)
app.UseTwitterAuthentication(
consumerKey: settings.TwitterConsumerKey,
consumerSecret: settings.TwitterConsumerSecret);
if (settings.UseMicrosoftLogin)
app.UseMicrosoftAccountAuthentication(
clientId: settings.MicrosoftClientID,
clientSecret: settings.MicrosoftClientSecret);
if (settings.UseFacebookLogin)
app.UseFacebookAuthentication(
appId: settings.FacebookAppID,
appSecret: settings.FacebookAppSecret);
if (settings.UseGoogleLogin)
app.UseGoogleAuthentication(settings.GoogleClientId, settings.GoogleClientSecret);
}
}
}
कोई विचार?
इस समस्या का समाधान खोजने के लिए प्रबंधित करें? मैं वही अनुभव कर रहा हूं जब मैं संस्करण 3.0.1 –
में कोई खुशी नहीं हूं। मेरे पास स्रोत देखने और तुलना करने का समय नहीं है। –