Login not possible when using IDS4 together with ASP.NET Identity following the quickstart example #2510
Comments
I'm in the same boat, though I feel like this is probably a duplicate issue... just worded differently somewhere else. |
Ha. As luck would have it, I think I just got it working. This post was extremely helpful. I did scaffold Identity as instructed. Also, here's my full
|
@alexdresko thank you for your post - this solved my problem! Even I needed to update your code with adjustments from the other thread you mentioned ... I am very happy now :) Here is my complete running project (its just the running quickstart example without any other functionality) - so everybody with the same problem can look into it how we solved it: I hope the IDS4 team will update the official documentation with the needed adjustments for .NET Core 2.1. |
I finally had a chance to look into this. The problem is that IdentityServer (build 2.3 and prior) requires the host to have configured a default authentication scheme. This is how we know who the user is. In ASP.NET Identity prior to their 2.1 changes, they set this in the call to AddIdentity. Well, in 2.1 for their self-contained UI they changed how they're doing it. Instead they only set a default scheme, and that's not sufficient. So if you were to simply have added this line:
after you register IdentityServer, then all would be well. Oh, you would also need to set the paths for login/logout on the InteractionOptions on IdentityServer. Sorry for so many problems on this issue. As I indicated elsewhere, I agree with many of you that the new ASP.NET Core UI is a real problem and not terribly realistic for production use. Unfortunately it requires this sort of lower level tinkering. Given that we now know the issue, we're going to make the IdentityServer configuration (when you use our AddAspNetIdentity API) to be more defensive in how it sets things up. |
Part of this is already fixed here; IdentityServer/IdentityServer4.AspNetIdentity@58b8950 The other part depends on this PR which is yet to be merged: #2540 |
I'm going to close this, as the other two issues will provide resolution. Thanks. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I want to build a Identity Server OIDC service, having an additional simple ui for registration/profile/email-notification of the users.
So I followed the official quickstart manual to achieve this: http://docs.identityserver.io/en/release/quickstarts/6_aspnet_identity.html
first I built the ui with the Visual Studio 2017 default template for ASP.NET Core Identity (.NET Core 2.1.2), so I can perfectly register new users and can login/logout with it, incl. storage to database.
I didnt change the hosting, so hosting is via IIS Express, using HTTPS: https://localhost:44348 - works great so far.
Then I added IdentityServer4 2.1 (via Nuget) to that project additionally - and the steps described in that manual. After that I can start the service and still can register a new user with ASP.NET Identity - but when I try to login in the login dialog and pressing OK, the home page (!) will be shown again (with register/login upper right) - instead that the user is logged-in as expected (-> I cannot see the logged in email/username in the navigation and no logout-button is shown - which worked nice before in step 1). The same happens when registering a new user - the user credentials are stored correct in the database, but is not logged in after registration!
I attached my project:
IDS4ASPI.zip
Issue / Steps to reproduce the problem
Relevant parts of the log file
I tried this multiple times since two week and getting more and more frustrated - can anybody help me, to bring the offical quickstart demo to run?
THANKS in advance!
Patrick
The text was updated successfully, but these errors were encountered: