Versuch Thinctecture identityserver v3 als einfacher M. für mehr mvc Anwendungen zu verwenden.
Ich bin durch die Beispielanwendungen zur Verfügung gestellt gehen kann und die Flucht in Ordnung, aber sie alle nutzen eingebettet identityserver. Ich brauche den Identityserver als separate Anwendung, damit ich ihn für mehrere Apps als St verwenden kann. Wenn ich versuche, den Identityserver zu starten und die Probe-mvc-Anwendung zu verbinden, scheint etwas zu fehlen.thinktecture identityserver v3
Die Probe mvc App nutzt katana
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions...
aber verstehe ich einfach nicht, wie richtig für externe App-Service-Konfiguration. Meine Vermutung ist, dass ich nicht den richtigen Endpunkt verwende.
Hier ist meine vertrauende Konfiguration als mvc. Ich habe dann die neueste hier unberührt v3 läuft: : 44333
In dem MVC-app, wenn ich versuche zu einer Ansicht zu navigieren, die Genehmigung erfordert ich die Exception.
Stack Trace:
[HttpRequestException: Response status code does not indicate success: 404 (Not Found).]
System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() +87960
Microsoft.IdentityModel.Protocols.<GetDocumentAsync>d__0.MoveNext() +496
[IOException: Unable to get document from: https://localhost:44333/.well-known/openid-configuration]
Microsoft.IdentityModel.Protocols.<GetDocumentAsync>d__0.MoveNext() +830
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52
System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +24
Microsoft.IdentityModel.Protocols.<GetAsync>d__0.MoveNext() +512
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52
System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +24
Microsoft.IdentityModel.Protocols.<GetConfigurationAsync>d__3.MoveNext() +1332
hier ist die volle Auth config in der MVC-app.
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
{
//Authority = "https://localhost:44319/identity",
Authority = "https://localhost:44333",
ClientId = "mvc",
Scope = "openid profile roles",
RedirectUri = "https://localhost:44319/",
SignInAsAuthenticationType = "Cookies",
UseTokenLifetime = false,
Notifications = new OpenIdConnectAuthenticationNotifications
{
SecurityTokenValidated = async n =>
{
var id = n.AuthenticationTicket.Identity;
// we want to keep first name, last name, subject and roles
var givenName = id.FindFirst(Constants.ClaimTypes.GivenName);
var familyName = id.FindFirst(Constants.ClaimTypes.FamilyName);
var sub = id.FindFirst(Constants.ClaimTypes.Subject);
var roles = id.FindAll(Constants.ClaimTypes.Role);
// create new identity and set name and role claim type
var nid = new ClaimsIdentity(
id.AuthenticationType,
Constants.ClaimTypes.GivenName,
Constants.ClaimTypes.Role);
nid.AddClaim(givenName);
nid.AddClaim(familyName);
nid.AddClaim(sub);
nid.AddClaims(roles);
// keep the id_token for logout
nid.AddClaim(new Claim("id_token", n.ProtocolMessage.IdToken));
// add some other app specific claim
nid.AddClaim(new Claim("app_specific", "some data"));
n.AuthenticationTicket = new AuthenticationTicket(
nid,
n.AuthenticationTicket.Properties);
},
RedirectToIdentityProvider = async n =>
{
if (n.ProtocolMessage.RequestType == OpenIdConnectRequestType.LogoutRequest)
{
var idTokenHint = n.OwinContext.Authentication.User.FindFirst("id_token");
if (idTokenHint != null)
{
n.ProtocolMessage.IdTokenHint = idTokenHint.Value;
}
}
}
}
});
Nun, ich habe ein wenig weiter, würde aber immer noch Führung meiner Dummheit schätzen, wenn jemand bereit zu bieten ist. Durch Ändern der Autorität und Hinzufügen der MeadadAddress zu der mvc-Konfiguration war ich dabei, es zum Laufen zu bringen. Authority = "https://idsrv3.com", MetadataAddress = "https: // localhost: 44333/core/.nun bekannt/openid-Konfiguration", – Aaron792000
können Sie den Inhalt der Startup.cs Datei hinzufügen Sie verwendet um IdentityServerv3 zu konfigurieren? Ich habe auch ein Tutorial IdSrv3 zu konfigurieren, da haben Sie die Konfiguration von Idsrv und auch eine MVC-app, dass einige öffentliche Ressource anfordert, nachdem der Benutzer Zustimmung gab: [Link zum Tutorial] (http://cedric-dumont.com/tutorials/ identityserver-v3-membershipreboot-AngularJS-WebAPI-2-und-mvc-mix-it-Einführung /) –
ich mit diesem Thema zu fördern, die Seite aktualisiert es gelöst. Es scheint, dass die STS-Seite einige Zeit nicht antwortet. –