Ich habe eine nicht-Kern-Webapi und einen Identity-Server v3. Jetzt möchte ich eine asp-Core-Website implementieren. Die asp-Kern-Test-Website läuft auf http://localhost:49946/
Ist es möglich, eine ASP-Core-Site mit einem Identityserver v3 STS-Server zu verwenden? Gibt es bekannte Probleme?Core MVC Client mit IdentityServer v3 verwenden - Die Client-Anwendung ist nicht bekannt oder nicht autorisiert
versuchte ich es, aber ich bekomme immer
Die Client-Anwendung ist nicht bekannt oder nicht autorisiert ist.
Ich habe sichergestellt, dass die Umleitung URI und die Client-ID übereinstimmen.
Hier mein client config in der identityserver
return new Client
{
Enabled = true,
ClientId = "website",
ClientName = "Site",
Flow = Flows.Implicit,
AllowedScopes = new List<string>
{
Constants.StandardScopes.OpenId,
Constants.StandardScopes.Email,
Constants.StandardScopes.Profile,
Constants.StandardScopes.AllClaims,
Constants.StandardScopes.Roles,
"read","warehouseapi"
},
RedirectUris = new List<string>
{"http://localhost:49946/"
},
PostLogoutRedirectUris = new List<string>
{
"http://localhost:49946/"
}
};
Hier ist die Konfiguration für den asp Kern mvc Client
app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
{
AuthenticationScheme = "oidc",
SignInScheme = "Cookies",
Authority = "http://localhost:7890",
RequireHttpsMetadata = false,
ClientId = "website",
ResponseType = "id_token token",
Scope = { "openid profile email warehouseapi" },
GetClaimsFromUserInfoEndpoint = true,
SaveTokens = true,
AutomaticAuthenticate = true,
AutomaticChallenge = true,
});
hier die URL, die der Client leitet, wenn er will, authentifizieren. Sie können dort sehen, dass umleiten uri zu http://localhost:49946/
http://localhost:7890/connect/authorize?client_id=website&redirect_uri=http%3A%2F%2Flocalhost%3A49946%2Fsignin-oidc&response_type=id_token%20token&scope=openid%20profile%20openid%20profile%20email%20warehouseapi&response_mode=form_post&nonce=636115164423104247.ZjY0MjY4OTctZWY3Ny00MGE2LTg4NDAtOWEzZWQyMmQ0NDY5YzJiOWRiNDQtYWY4Yy00MjE2LWE5ZWEtNTA3ZmU3MThkNzBi&state=CfDJ8Faq7VwoA29ApMd_ECq59Rnz2OH_juBD61Mbr40-8VxMsE4i5s5i-jNyb4LdOBYcCAvojnXLPzGy5fvm3c0eNcCnALfy2M2Pl_k0eXcxwXIlF9D_GBmPH5EwsQTXXP5jNBaPuFuxpFM-5tbdSkiqQbdpeddgO7LBPqqxlHcu3MB7e0MOBcPsVOKcTfXwUMG_cWDCoUldgu4k-CjunCTsXOnS7VWpg8ICEP8fcMM8q5GY8KfZFHoOPzu5_24SOLhAeujPF2l_YkVQJRY-QMmv-IWThjk97ewZE8Pl8uIyof38B0lRtbYeE0ChBbM4Wx5O-3yFtTVaT46gtXxqdn4lny39Te1b0SFsG5-LqzZrtTw-RZ_EMZO9wbdd4uwXoifjXg
Ist das nur ein Kompatibilitätsproblem festgelegt ist? was ich beaufsichtige?
- aktualisieren
Thx auf den Hinweis von leastprivilege fand ich die Lösung im Protokoll. Es gab eine unerwartete subpath /signin-oidc
In Trace I
2016-10-08 13:07:41.450 +02:00 [Information] Start authorize request
2016-10-08 13:07:41.465 +02:00 [Information] Start authorize request protocol validation
2016-10-08 13:07:41.498 +02:00 [Error] "Invalid redirect_uri: http://localhost:49946/signin-oidc"
"{
\"ClientId\": \"website\",
\"ClientName\": \"Pluto Site\",
\"RedirectUri\": \"http://localhost:49946/signin-oidc\",
\"AllowedRedirectUris\": [
\"http://localhost:49946/\"
],
\"SubjectId\": \"unknown\",
\"Flow\": \"AuthorizationCode\",
\"RequestedScopes\": \"\",
\"Raw\": {
\"client_id\": \"website\",
\"redirect_uri\": \"http://localhost:49946/signin-oidc\",
\"response_type\": \"id_token token\",
\"scope\": \"openid profile openid profile email warehouseapi\",
\"response_mode\": \"form_post\",
\"nonce\": \"636115215901620557.ZTNkNmFmYjMtOTY4MC00ODE3LWExMmEtYTc0OWYzYzRkZmY4MDRlM2JjZjUtZGViNC00MjIyLWI1MTktOTM4Y2U2MWFkYzkw\",
\"state\": \"CfDJ8Faq7VwoA29ApMd_ECq59RmXQrEZdMEoqQ9onYQLXRTRz-ge13paqnwmi_xjJMoVpaItur0ETX08PxoOzQ-YUn--7DR1pvaxqUngPYOiS44j4t9bS4_yiu7Gb1fjU_R5OiZU2cc-0T6PzT_WgUZ48rqC-unHdJqd_NgE7D_9H9ZT1a-2J3GBZEkfh4LOCHHtfcuG06lgXTPn85fkVKcWxbqn6pTrCLRhiRfH9h41e6bvKsGTOmzJ45G9HRpEAlyo7GkgtFgrrshKNo0xDsIxXjAhxp_me_tipBEpyHT8Mo7T9G4-HTtP8FSnb7YurSWjfywOpEG136-T7wvksCEwlMGrL8k90v6prM-bwefOhCFA-8vJO1hvtKkF3wPSgeMiYg\"
}
}"
Logfiles oder nie passiert – leastprivilege
Von Identityserver oder Client? –
@leastprivilege thx für diesen Hinweis. Ich habe es selbst mit dem Protokoll gefunden siehe post update –