IdentityServer4.Admin icon indicating copy to clipboard operation
IdentityServer4.Admin copied to clipboard

Install Admin GUI with existing IdentityServer database/service

Open heavyflames opened this issue 3 years ago • 7 comments

Im trying to follow the guide :https://github.com/skoruba/IdentityServer4.Admin/blob/master/docs/Configure-Administration.md

But when trying to use " services.AddDbContexts<AdminIdentityDbContext, IdentityServerConfigurationDbContext, IdentityServerPersistedGrantDbContext, AdminLogDbContext>(HostingEnvironment, Configuration); " It complains that it does not exists. Im finding the guides very confusing... :/

Any ideas on how to implement only the Admin GUI for an existing IdentityServer4 ?

heavyflames avatar Oct 14 '21 13:10 heavyflames

Hey @heavyflames - these DbContexts are part of the Admin project template - what did you try? Did you try to use these DbContext in your IdentityServer instance or where?

Thanks

skoruba avatar Oct 17 '21 07:10 skoruba

Hi, well the guide says I should edit the Startup.cs in the Admin project: Skoruba.IdentityServer4.Admin - Startup.cs - method ConfigureServices

But services.AddDbContexts does not exists for me. Am I reading the guide wrong? Or where should I edit this if not in that project?

heavyflames avatar Oct 18 '21 08:10 heavyflames

Hi again, ok I see now that we need to implement some of the helper methods in our IdentityServer instance, but I fin the guide confusing on what exacly I need to do to get it to work.

heavyflames avatar Oct 20 '21 06:10 heavyflames

Hey @heavyflames - I have to check it the guide, can you please send a PR with some modifications in the guide which could help to someone else?

Thanks

skoruba avatar Oct 20 '21 07:10 skoruba

Am I right when I say that Skoruba.IdentityServer4.STS.Identity is the IdentityServer instance in this case? If we are using our existing IdentityServer this is not "needed" for the Admin portal? I.e we need to make adjustments in our instance of identityserver?

Cant make a PR if I dont know what to do :) It would be great if the guide is more step by step. Like 1: "Do this in this file" 2: "Replace bla bla in file xxxx"

heavyflames avatar Oct 20 '21 08:10 heavyflames

If I change all the db connectionstrings in the admin project to use our existing identityserver database, and redirect to our existing identityserver site, after login in there it redirects back to the admin portal but I get an access denied error, it redirects me to :https://localhost:44303/Account/AccessDenied?ReturnUrl=%2F

Im guessing its because I need to change something more somewhere?

heavyflames avatar Oct 20 '21 09:10 heavyflames

Hi HeavyFlames, I had this happen when the Role that it is looking for is not coming back.

In your app settings there should be a "AdministrationRole" which specifies the role required.

Norrch2 avatar Nov 03 '21 16:11 Norrch2