Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting sample IS to database managed by IdentityServer4.Admin #30

Closed
xmichaelx opened this issue Jun 19, 2018 · 9 comments
Closed
Assignees
Milestone

Comments

@xmichaelx
Copy link
Contributor

Hello,

First of all, big thanks for doing this. You saved me a tremendous amount of work.

Why haven't you connected IdentityServer4 to the database modified by Admin panel? I understand that you could've done for the sake of simplicity and that's why you've opted for in memory stores but I'm curious if there's any other reason.

I'm working on having IS from Skoruba.IdentityServer4 connected to database modified in Skoruba.IdentityServer4.Admin. If I connect them are you interested in a pull request?

@skoruba
Copy link
Owner

skoruba commented Jun 19, 2018

Hello @xmichaelx

I really appreciate your feedback.

You are right, the in-memory users / clients in Skoruba.IdentityServer4 are for simplicity.

I will be happy for any pull request from you. I will consider your idea.

It's possible to follow this sample for doing that - https://github.com/IdentityServer/IdentityServer4.Samples/tree/release/Quickstarts/Combined_AspNetIdentity_and_EntityFrameworkStorage

Btw: What do you think about issue #28 - creating the UI and services as nuget package?

@skoruba skoruba self-assigned this Jun 19, 2018
@skoruba skoruba added this to the 1.0.0-beta-1 milestone Jun 19, 2018
@xmichaelx
Copy link
Contributor Author

xmichaelx commented Jun 19, 2018

Certainly, it would be nice to have a nuget package. Add to that some ability for branding with additional powered by <here your credentials> and you have a very nice, generic solution.

@xmichaelx
Copy link
Contributor Author

Right now I'm trying to reference AdminDbContext but for that I need to reference dll with Skoruba.IdentityServer4.Admin. Unfortunately this creates situation where I reference another MVC project and I fail because of:

InvalidOperationException: The AuthorizationPolicy named: 'RequireAdministratorRole' was not found.

As I understand this policy is present on controllers in the Skoruba.IdentityServer4.Admin.Controllers namespace. I need to find a way to only reference AdminDbContext without MVC picking up all MVC stuff from the other assembly :)

@skoruba
Copy link
Owner

skoruba commented Jun 19, 2018

It's interesting. I think it's time to split the project into two parts - UI and Services.

Thank you - I'll check it and create some fix for this use case. :)

@xmichaelx
Copy link
Contributor Author

xmichaelx commented Jun 19, 2018

This is quick&dirty:

var builder = services.AddMvc();
// this removes assembly which is included for AdminDbContext only
var admin = builder.PartManager.ApplicationParts.Single(x => x.Name == "Skoruba.IdentityServer4.Admin");
builder.PartManager.ApplicationParts.Remove(admin);

but works.

@skoruba
Copy link
Owner

skoruba commented Jun 19, 2018

I see. :) I think, splitting of the solution will be better approach - but good quick workaround.

@xmichaelx
Copy link
Contributor Author

I agree, splitting solution will be much better.

@skoruba skoruba modified the milestones: 1.0.0-beta-1, 1.0.0-beta-2 Jul 8, 2018
@skoruba
Copy link
Owner

skoruba commented Jul 12, 2018

#41 - splitting solution, next step will be switching the inmemory store to the database.

@skoruba
Copy link
Owner

skoruba commented Jul 24, 2018

DONE.

@skoruba skoruba closed this as completed Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants