Ich habe OpenID Connect Authentifizierung in meiner ASP.NET MVC-Anwendung mit OWIN Middleware eingerichtet.Azure OpenID Connect über OWIN Middleware führt zu Infinite Redirect Loop
Wie diese Fiddler-Ausgabe zeigt, führt der Browser, nachdem er sich erfolgreich über Azure OpenID Connect angemeldet hat, fortlaufend zwischen meiner site.azurewebsites.net und login.windows.net hin und her.
Ich habe folgende Schlüssel sichergestellt richtig Azure AD Informationen
<add key="ida:AADInstance" value="https://login.windows.net/{0}" />
<add key="ida:Tenant" value="******.onmicrosoft.com" />
<add key="ida:ClientId" value="*******" />
<add key="ida:PostLogoutRedirectUri" value="*********" />
Und mein Start.cs Code ist passen wie folgt
private static string clientId = ConfigurationManager.AppSettings["ida:ClientId"];
private static string aadInstance = ConfigurationManager.AppSettings["ida:AADInstance"];
private static string tenant = ConfigurationManager.AppSettings["ida:Tenant"];
private static string postLogoutRedirectUri = ConfigurationManager.AppSettings["ida:PostLogoutRedirectUri"];
private string authority = String.Format(CultureInfo.InvariantCulture, aadInstance, tenant);
IAuthorizationService authorizationService = new AuthorizationService();
public void ConfigureAuth(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions()
{
ExpireTimeSpan =TimeSpan.FromMinutes(15)
});
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
ClientId = clientId,
Authority = authority,
PostLogoutRedirectUri = postLogoutRedirectUri}
});
}
}
nicht sicher, was ist der Grund dafür zu ständig umleiten. Ich habe ein [Authorize]
-Attribut auf dem MVC-Controller platziert, wo Post Authentication Redirect Url geht.
schlagen Sie zunächst die Website nur auf http? nicht https? Ich habe das gleiche Szenario, wo ich, wenn ich die Website nur mit http trete, werde ich weitergeleitet, um sich anzumelden, wird authentifiziert, umgeleitet zurück und endet in einer Schleife. endete damit, https zu zwingen. – JuneT
Alles wird auf HTTPS zugegriffen. – puri
Haben Sie jemals eine Lösung für Ihr Problem gefunden? Ich habe ein ähnliches Problem. Die folgende Antwort hat nicht geholfen. – dave