Jako kontynuacja this question, istnieje problem z dotnetopenauth.Czy dziedzina OpenID musi być podstawowym adresem URL strony internetowej?
W zasadzie zastanawiam się, czy dziedzina określona w RP musi być faktycznym podstawowym adresem URL aplikacji? To znaczy (http://localhost:1903
)? Biorąc pod uwagę istniejącą architekturę, trudno jest usunąć przekierowanie - próbowałem ustawić dziedzinę do podstawowego kontrolera OpenId (http://localhost:1903/OpenId
), a testowanie ręcznie wygenerowało dokument XRDS. Jednakże zastosowanie wydaje się zamrażać, a dziennik EP ujawnia następujący błąd:
2012-10-10 15:17:46,000 (GMT-4) [24] ERROR DotNetOpenAuth.OpenId - Attribute Exchange extension did not provide any aliases in the if_available or required lists.
Kod:
Powołując Party:
public ActionResult Authenticate(string RuserName = "")
{
UriBuilder returnToBuilder = new UriBuilder(Request.Url);
returnToBuilder.Path = "/OpenId/Authenticate";
returnToBuilder.Query = null;
returnToBuilder.Fragment = null;
Uri returnTo = returnToBuilder.Uri;
returnToBuilder.Path = "/";
Realm realm = returnToBuilder.Uri;
var response = openid.GetResponse();
if (response == null) {
if (Request.QueryString["ReturnUrl"] != null && User.Identity.IsAuthenticated) {
} else {
string strIdentifier = "http://localhost:3314/User/Identity/" + RuserName;
var request = openid.CreateRequest(
strIdentifier,
realm,
returnTo);
var fetchRequest = new FetchRequest();
request.AddExtension(fetchRequest);
request.RedirectToProvider();
}
} else {
switch (response.Status) {
case AuthenticationStatus.Canceled:
break;
case AuthenticationStatus.Failed:
break;
case AuthenticationStatus.Authenticated:
//log the user in
break;
}
}
return new EmptyResult();
}
Provider:
public ActionResult Index()
{
IRequest request = OpenIdProvider.GetRequest();
if (request != null) {
if (request.IsResponseReady) {
return OpenIdProvider.PrepareResponse(request).AsActionResult();
}
ProviderEndpoint.PendingRequest = (IHostProcessedRequest)request;
return this.ProcessAuthRequest();
} else {
//user stumbled on openid endpoint - 404 maybe?
return new EmptyResult();
}
}
public ActionResult ProcessAuthRequest()
{
if (ProviderEndpoint.PendingRequest == null) {
//there is no pending request
return new EmptyResult();
}
ActionResult response;
if (this.AutoRespondIfPossible(out response)) {
return response;
}
if (ProviderEndpoint.PendingRequest.Immediate) {
return this.SendAssertion();
}
return new EmptyResult();
}
Czy możesz opracować zamrożenie? Czy to przeglądarka zawiesza się? A może strona internetowa po prostu się nie zmienia w pewnym momencie przepływu? Czy wchodzisz w nieskończone przekierowania? –