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

Extract UI project for use in existing setups (v2) #779

Merged
merged 45 commits into from Feb 13, 2021

Conversation

Brice-xCIT
Copy link
Contributor

This PR enables consumers to use the UI with an existing IdentityServer4 environment, by letting arbitrary Startup code to inject the UI into an existing application's pipeline. This essentially solves issues #770, #409, #55, #322, #133 and maybe more.

services.AddIdentityServer4AdminUI(...), app.UseIdentityServer4AdminUI() and endpoints.MapIdentityServer4AdminUI() are now exposed, with a wide range of configuration options that support both option binding to appsettings and programmatic configuration.

The UI is now provided as an area, which should allow it to be added to a single application alongside the STS. It should also be extensible since the project is a Razor Class Library. And of course using the UI in a standalone application is natural, as demonstrated by the Admin app.

skoruba and others added 30 commits November 17, 2020 14:13
@Brice-xCIT
Copy link
Contributor Author

@skoruba This is it. Let me know if you see anything wrong!

@skoruba
Copy link
Owner

skoruba commented Jan 12, 2021

@Brice-xCIT - thanks for your PR, I will check it. 👍

@skoruba skoruba changed the base branch from master to release/2.0.0-beta1 January 12, 2021 15:41
@skoruba
Copy link
Owner

skoruba commented Jan 13, 2021

Hey @Brice-xCIT - I switched this PR to release/2.0.0-beta-1 - but there are conflicts, could you please check it?
Thanks!

@Brice-xCIT
Copy link
Contributor Author

Hi! Dang it, I seem to have branched out at the wrong place :( I will look into resolving the conflicts.
However would you consider making a 1.x release out of this still? 2.0 seems to come with a mandatory upgrade to IS4 4.x, which itself comes with breaking changes.

…ure/extract-ui-package-v2-merge

# Conflicts:
#	src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Views/Home/Index.cshtml
#	src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Views/Shared/_Layout.cshtml
#	src/Skoruba.IdentityServer4.Admin.UI/Helpers/StartupHelpers.cs
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiResource/Section/Label.fr.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope.da.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope.de.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope.en.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope.es.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope.fa.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope.fi.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope.fr.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope.pt.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope.ru.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope.sv.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope.zh.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope/Section/Label.da.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope/Section/Label.de.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope/Section/Label.en.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope/Section/Label.es.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope/Section/Label.fa.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope/Section/Label.fi.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope/Section/Label.fr.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope/Section/Label.pt.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope/Section/Label.ru.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope/Section/Label.sv.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScope/Section/Label.zh.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopeProperties.da.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopeProperties.de.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopeProperties.en.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopeProperties.es.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopeProperties.fa.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopeProperties.fi.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopeProperties.fr.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopeProperties.pt.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopeProperties.ru.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopeProperties.sv.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopeProperties.zh.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopePropertyDelete.da.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopePropertyDelete.de.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopePropertyDelete.en.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopePropertyDelete.es.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopePropertyDelete.fa.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopePropertyDelete.fi.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopePropertyDelete.fr.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopePropertyDelete.pt.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopePropertyDelete.ru.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopePropertyDelete.sv.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Configuration/ApiScopePropertyDelete.zh.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Log/AuditLog.da.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Log/AuditLog.es.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Log/AuditLog.fa.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Log/AuditLog.fr.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Log/AuditLog.ru.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Log/AuditLog.sv.resx
#	src/Skoruba.IdentityServer4.Admin.UI/Resources/Areas/AdminUI/Views/Log/AuditLog.zh.resx
#	src/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj
#	src/Skoruba.IdentityServer4.Admin/Startup.cs
@Brice-xCIT Brice-xCIT changed the title Extract UI project for use in existing setups Extract UI project for use in existing setups (v2) Jan 13, 2021
@Brice-xCIT
Copy link
Contributor Author

Conflicts are resolved for v2.x.

@skoruba
Copy link
Owner

skoruba commented Jan 14, 2021

@Brice-xCIT - thanks for your great work! I will check both version 👍

@skoruba
Copy link
Owner

skoruba commented Jan 14, 2021

I've tested this version and everything work really great, even I've tried overwrite some resource, view and it works perfectly!
I will go througt the code and check all the details.
I am really impressed. 🚀❤

@Brice-xCIT
Copy link
Contributor Author

Brice-xCIT commented Jan 15, 2021

I'm glad to hear it's working out well! :) I wouldn't be surprised if there were some minor hiccups there and there, or if the code could be further cleaned up or refactored. Also, I didn't do anything with regards to setting up the NuGet package.

@skoruba
Copy link
Owner

skoruba commented Jan 15, 2021

@Brice-xCIT - for sure, I will take a look at details. 👍 Do you think that similar thing we can do it with Admin.Api project in the future? Extract api controllers to separate package and reference it through the nuget package as well like UI?
Thanks!

@Brice-xCIT
Copy link
Contributor Author

I think the same could be done without too many issues for the API - it is very symmetrically implemented. Maybe in the process some common types could be further extracted down to Admin.Shared. I won't have much time to work on the API in the coming months, though :/

@skoruba
Copy link
Owner

skoruba commented Jan 20, 2021

@Brice-xCIT - For sure, I will check it and make some appropriate changes. 👍

@skoruba skoruba changed the base branch from release/2.0.0-beta1 to release/2.0.0 February 13, 2021 11:26
@skoruba skoruba merged commit 7d8f493 into skoruba:release/2.0.0 Feb 13, 2021
@jotatoledo
Copy link

jotatoledo commented Mar 12, 2021

is there any guide to use this feature? sorry for bumping this, I wasnt sure if opening a new issue just to ask this is right.

UPDATE: found the following #770

@skoruba
Copy link
Owner

skoruba commented Mar 12, 2021

@jotatoledo - Yep 😊 it is not documented yet. But in the branch called release/2.0.0 is now available.

@skoruba skoruba mentioned this pull request Apr 26, 2021
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

Successfully merging this pull request may close these issues.

None yet

3 participants