Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit 504d350

Browse files
committed
Merge remote-tracking branch 'remotes/tepm/master'
# Conflicts: # README.md # src/Backend/Jp.Domain/CommandHandlers/ClientCommandHandler.cs # src/Backend/Jp.UserManagement/Controllers/ClientController.cs # src/Backend/Jp.UserManagement/jpProject_sso_log.txt # src/Frontend/Jp.AdminUI/src/app/core/interceptors/auth.interceptor.ts # src/Frontend/Jp.UI.SSO/Configuration/SecurityHeadersConfiguration.cs # src/Frontend/Jp.UI.SSO/jpProject_sso_log.txt
2 parents c01a546 + 349c7b8 commit 504d350

File tree

172 files changed

+15112
-7270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+15112
-7270
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.env
33
.git
44
.gitignore
5-
.vs/
5+
**/.vs/
66
.vscode
77
*/bin
88
*/obj

CHANGELOG.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,73 @@
1+
## v1.1.0
2+
3+
* Now you can run through a docker! ❤️
4+
* Unfortunately you need to change hosts for it. Because Authority URL. I can't do anything to face it. It's security feature from OAuth2 to keep same Authority name for each Token.
5+
6+
7+
* Update of main Context, JpProject
8+
* Removed previous components from MySql.Migrations and Sql.Migrations. Unified in same project.
9+
10+
* Client Page:
11+
* Changed Claims button to be under Token - Following Docs from [IdentityServer4](https://identityserver4.readthedocs.io/en/latest/reference/client.html#token)
12+
* Included Device Flow options
13+
14+
Updates:
15+
* @angular/cli to 7.3.6
16+
* @angular/core to 7.2.10 (ng update @angular/core, then it updated other dep's)|
17+
* @angular/language-service @ "7.2.10" (was "6.0.0")...
18+
* @angular/compiler-cli @ "7.2.10" (was "6.0.0")...
19+
* @angular/animations @ "7.2.10" (was "6.0.0")...
20+
* @angular/compiler @ "7.2.10" (was "6.0.0")...
21+
* @angular/common @ "7.2.10" (was "6.0.0")...
22+
* @angular/core @ "7.2.10" (was "6.0.0")...
23+
* @angular/http @ "7.2.10" (was "6.0.0")...
24+
* @angular/forms @ "7.2.10" (was "6.0.0")...
25+
* @angular/platform-browser-dynamic @ "7.2.10" (was "6.0.0")...
26+
* @angular/platform-browser @ "7.2.10" (was "6.0.0")...
27+
* @angular/router @ "7.2.10" (was "6.0.0")...
28+
* zone.js @ "0.8.29" (was "0.8.26")...
29+
* rxjs @ "6.4.0" (was "6.0.0")...
30+
* typescript @ "3.2.4" (was "2.7.2")
31+
32+
Updated components from UI:
33+
34+
|dependency|old version| new version|
35+
|----------|-----------|------------|
36+
|@agm/core| 1.0.0-beta.2| → 1.0.0-beta.5|
37+
|@ng-bootstrap/ng-bootstrap |^3.2.2| → ^4.1.0|
38+
|@ngx-translate/core| 10.0.1| → 11.0.1|
39+
|@ngx-translate/http-loader| 3.0.1| → 4.0.0|
40+
|@swimlane/ngx-datatable| 12.0.0| → 14.0.0|
41+
|ag-grid| 17.1.1| → 18.1.2|
42+
|ag-grid-angular| 17.1.0| → 20.2.0|
43+
|angular-oauth2-oidc |^4.0.2| → ^5.0.2|
44+
|angular-tree-component| 7.0.1| → 8.3.0|
45+
|bootstrap| 4.1.1| → 4.3.1|
46+
|chart.js| 2.7.2| → 2.8.0|
47+
|codemirror| 5.37.0| → 5.45.0|
48+
|enhanced-resolve| 3.3.0| → 4.1.0|
49+
|fullcalendar| 3.9.0| → 3.10.0|
50+
|lodash| 4.17.10| → 4.17.11|
51+
|modernizr| 3.6.0| → 3.7.1|
52+
|moment| 2.22.1| → 2.24.0|
53+
|ng2-charts| 1.6.0| → 2.0.4|
54+
|ng2-material-dropdown| 0.9.5| → 0.10.1|
55+
|ngx-chips |^1.9.8| → ^2.0.0-beta.0|
56+
|ngx-color-picker| 6.0.0| → 7.4.0|
57+
|ngx-infinite-scroll| 0.8.4| → 7.1.0|
58+
|popper.js| 1.14.3| → 1.14.7|
59+
|screenfull| 3.3.2| → 4.1.0|
60+
|summernote| 0.8.10| → 0.8.11|
61+
|sweetalert| 1.1.3| → 2.1.2|
62+
|ts-helpers| 1.1.1| **removed**|
63+
|web-animations-js| 2.2.1| → 2.3.1|
64+
|zone.js| 0.8.29| → 0.9.0|
65+
|@angular-devkit/build-angular| 0.6.1| → 0.13.6|
66+
|@types/lodash| 4.14.108| → 4.14.123|
67+
|codelyzer| 4.2.1| → 5.0.0-beta.2|
68+
|ts-node| 5.0.1| → 8.0.3|
69+
|tslint| 5.9.1| → 5.14.0|
70+
171
## v1.0.0
272

373
- First release

README.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,41 @@
55
[![License](https://img.shields.io/github/license/brunohbrito/jp-project.svg)](LICENSE)
66
![DOCS](https://readthedocs.org/projects/jp-project/badge/?version=latest&style=flat)
77

8-
Jp Project is a Open Source Admin UI for IdentityServer4.
8+
Jp Project is a Open Source UI Administration Panel for IdentityServer4.
9+
10+
11+
## Admin UI
12+
<img src="https://github.com/brunohbrito/JP-Project/blob/master/docs/images/jp-adminui.gif" width="480" />
13+
14+
## Login page
15+
<img src="https://github.com/brunohbrito/JP-Project/blob/master/docs/images/login.JPG?raw=true" width="480" />
16+
17+
## Consent page
18+
<img src="https://github.com/brunohbrito/JP-Project/blob/master/docs/images/consent-page.JPG?raw=true" width="480" />
19+
20+
## Profile
21+
<img src="https://github.com/brunohbrito/JP-Project/blob/master/docs/images/jp-usermanagement.gif" width="480" />
22+
923

1024
# We are online at Azure.
1125

26+
<img align="right" width="100px" src="https://www.developpez.net/forums/attachments/p289604d1/a/a/a" />
27+
1228
Check it now at [Jp Project](https://jpproject.azurewebsites.net/admin-ui/).
1329

1430
You can check also [SSO](https://jpproject.azurewebsites.net/sso/) and [User Management](https://jpproject.azurewebsites.net/user-management/)
1531

32+
1633
_New users are readonly_
1734

18-
<img align="right" width="100px" src="https://www.developpez.net/forums/attachments/p289604d1/a/a/a" />
35+
1936
Written in ASP.NET Core and Angular 6.
2037
The main goal of project is to be a Management Ecosystem for IdentityServer4. Helping Startup's and Organization to Speed Up the Setup of User Management. Helping teams and entrepreneurs to achieve the company's primary purpose: Maximize shareholder value.
2138

22-
# Features
39+
# How it was written
2340
- Angular 6
2441
- Rich UI interface
25-
- ASP.NET Core 2.1
42+
- ASP.NET Core 2.2
2643
- ASP.NET MVC Core
2744
- ASP.NET WebApi Core
2845
- ASP.NET Identity Core
@@ -60,19 +77,7 @@ Jp Project is built against ASP.NET Core 2.1.
6077

6178
Wait for ng to complete his proccess then go to http://localhost:5000!
6279

63-
# Screen Shots.
6480

65-
## Admin UI
66-
<img src="https://github.com/brunohbrito/JP-Project/blob/master/docs/images/admin-home.jpg?raw=true" width="480" />
67-
68-
## Login page
69-
<img src="https://github.com/brunohbrito/JP-Project/blob/master/docs/images/login.JPG?raw=true" width="480" />
70-
71-
## Consent page
72-
<img src="https://github.com/brunohbrito/JP-Project/blob/master/docs/images/consent-page.JPG?raw=true" width="480" />
73-
74-
## Profile
75-
<img src="https://github.com/brunohbrito/JP-Project/blob/master/docs/images/profile.JPG?raw=true" width="480" />
7681

7782
Any doubts? Go to docs
7883

@@ -104,4 +109,4 @@ There are several ways we can help you out.
104109

105110
Code coverage
106111

107-
Thinking about create separated repo's for each part of solution.
112+
Thinking about create separated repo's for each part of solution.

docs/images/jp-adminui.gif

9.56 MB
Loading

docs/images/jp-usermanagement.gif

1.39 MB
Loading

src/Backend/Jp.Application/Jp.Application.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="AutoMapper" Version="7.0.1" />
8+
<PackageReference Include="AutoMapper" Version="8.0.0" />
99
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
1010
<PackageReference Include="System.ComponentModel.Primitives" Version="4.3.0" />
1111
</ItemGroup>

src/Backend/Jp.Domain.Core/Jp.Domain.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<ItemGroup>
88
<PackageReference Include="mediatr" Version="4.1.0" />
9-
<PackageReference Include="FluentValidation" Version="8.0.0" />
9+
<PackageReference Include="FluentValidation" Version="8.1.3" />
1010
</ItemGroup>
1111

1212
</Project>

src/Backend/Jp.Domain/CommandHandlers/ClientCommandHandler.cs

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using System.Linq;
1313
using System.Threading;
1414
using System.Threading.Tasks;
15-
using IdentityServer4;
1615

1716
namespace Jp.Domain.CommandHandlers
1817
{
@@ -78,8 +77,7 @@ public async Task Handle(UpdateClientCommand request, CancellationToken cancella
7877
return;
7978
}
8079

81-
// Businness logic here
82-
var savedClient = await _clientRepository.GetClient(request.OldClientId);
80+
var savedClient = await _clientRepository.GetClient(request.Client.ClientId);
8381
if (savedClient == null)
8482
{
8583
await Bus.RaiseEvent(new DomainNotification("1", "Client not found"));
@@ -292,9 +290,7 @@ public async Task Handle(SaveClientCommand request, CancellationToken cancellati
292290
return;
293291
}
294292

295-
PrepareClientTypeForNewClient(request);
296-
var client = request.Client.ToEntity();
297-
client.Description = request.Description;
293+
var client = request.ToEntity();
298294

299295
_clientRepository.Add(client);
300296

@@ -304,33 +300,7 @@ public async Task Handle(SaveClientCommand request, CancellationToken cancellati
304300
}
305301
}
306302

307-
private void PrepareClientTypeForNewClient(SaveClientCommand command)
308-
{
309-
switch (command.ClientType)
310-
{
311-
case ClientType.Empty:
312-
break;
313-
case ClientType.WebImplicit:
314-
command.Client.AllowedGrantTypes = GrantTypes.Implicit;
315-
command.Client.AllowAccessTokensViaBrowser = true;
316-
break;
317-
case ClientType.WebHybrid:
318-
command.Client.AllowedGrantTypes = GrantTypes.Hybrid;
319-
break;
320-
case ClientType.Spa:
321-
command.Client.AllowedGrantTypes = GrantTypes.Implicit;
322-
command.Client.AllowAccessTokensViaBrowser = true;
323-
break;
324-
case ClientType.Native:
325-
command.Client.AllowedGrantTypes = GrantTypes.Hybrid;
326-
break;
327-
case ClientType.Machine:
328-
command.Client.AllowedGrantTypes = GrantTypes.ResourceOwnerPasswordAndClientCredentials;
329-
break;
330-
default:
331-
throw new ArgumentOutOfRangeException();
332-
}
333-
}
303+
334304

335305
public async Task Handle(CopyClientCommand request, CancellationToken cancellationToken)
336306
{

src/Backend/Jp.Domain/Commands/Client/ClientType.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public enum ClientType
77
WebHybrid = 2,
88
Spa = 3,
99
Native = 4,
10-
Machine = 5
10+
Machine = 5,
11+
Device=6
1112
}
1213
}

src/Backend/Jp.Domain/Commands/Client/SaveClientCommand.cs

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
using IdentityServer4.EntityFramework.Mappers;
2+
using IdentityServer4.Models;
13
using Jp.Domain.Validations.Client;
4+
using System;
25

36
namespace Jp.Domain.Commands.Client
47
{
58
public class SaveClientCommand : ClientCommand
69
{
7-
public string Description { get; }
810
public ClientType ClientType { get; }
911

1012
public SaveClientCommand(string clientId, string name, string clientUri, string logoUri, string description, ClientType clientType)
@@ -15,14 +17,87 @@ public SaveClientCommand(string clientId, string name, string clientUri, string
1517
ClientName = name,
1618
ClientUri = clientUri,
1719
LogoUri = logoUri,
20+
Description = description,
1821
};
19-
Description = description;
2022
ClientType = clientType;
2123
}
24+
25+
public IdentityServer4.EntityFramework.Entities.Client ToEntity()
26+
{
27+
PrepareClientTypeForNewClient();
28+
return Client.ToEntity();
29+
}
30+
31+
private void PrepareClientTypeForNewClient()
32+
{
33+
switch (ClientType)
34+
{
35+
case ClientType.Empty:
36+
break;
37+
case ClientType.Device:
38+
ConfigureDevice();
39+
break;
40+
case ClientType.WebImplicit:
41+
ConfigureWebImplicit();
42+
43+
break;
44+
case ClientType.WebHybrid:
45+
ConfigureWebHybrid();
46+
break;
47+
case ClientType.Spa:
48+
ConfigureSpa();
49+
break;
50+
case ClientType.Native:
51+
ConfigureNative();
52+
53+
break;
54+
case ClientType.Machine:
55+
ConfigureMachine();
56+
57+
break;
58+
default:
59+
throw new ArgumentOutOfRangeException();
60+
}
61+
}
62+
2263
public override bool IsValid()
2364
{
2465
ValidationResult = new SaveClientCommandValidation().Validate(this);
2566
return ValidationResult.IsValid;
2667
}
68+
69+
private void ConfigureDevice()
70+
{
71+
Client.AllowedGrantTypes = GrantTypes.DeviceFlow;
72+
Client.RequireClientSecret = false;
73+
Client.AllowOfflineAccess = true;
74+
}
75+
76+
private void ConfigureWebImplicit()
77+
{
78+
Client.AllowedGrantTypes = GrantTypes.Implicit;
79+
Client.AllowAccessTokensViaBrowser = true;
80+
}
81+
82+
private void ConfigureWebHybrid()
83+
{
84+
Client.AllowedGrantTypes = GrantTypes.Hybrid;
85+
}
86+
87+
private void ConfigureSpa()
88+
{
89+
Client.AllowedGrantTypes = GrantTypes.Implicit;
90+
Client.AllowAccessTokensViaBrowser = true;
91+
}
92+
93+
private void ConfigureNative()
94+
{
95+
Client.AllowedGrantTypes = GrantTypes.Hybrid;
96+
}
97+
98+
private void ConfigureMachine()
99+
{
100+
Client.AllowedGrantTypes = GrantTypes.ResourceOwnerPasswordAndClientCredentials;
101+
}
27102
}
28103
}

0 commit comments

Comments
 (0)