From ba6802296a45b1772703c6b619270665dbc57a7d Mon Sep 17 00:00:00 2001 From: Luke Wilson Date: Tue, 29 Jun 2021 14:38:37 +0100 Subject: [PATCH 1/2] fix: booking partners link and client registration location --- .gitignore | 3 + .../Custom/Account/AccountController.cs | 1 - .../Client/ClientRegistrationController.cs | 37 ++----- .../Custom/Client/ClientStore.cs | 4 +- .../Custom/Grants/BookingPartnerViewModel.cs | 2 - .../Grants/BookingPartnersController.cs | 104 +++++++++--------- .../Custom/Grants/PersistedGrantStore.cs | 37 +++---- .../Custom/Profile/ProfileService.cs | 5 - .../Custom/Resources/Config.cs | 1 - .../Resources/CustomIdentityResource.cs | 3 - .../Custom/Users/Extensions.cs | 4 - .../Custom/Users/Interfaces.cs | 8 +- .../Users/ResourceOwnerPasswordValidator.cs | 3 - .../Custom/Users/UserRepository.cs | 6 +- .../Program.cs | 2 +- .../Startup.cs | 3 - .../BookingPartnerCreate.cshtml | 3 +- .../BookingPartners/BookingPartnerEdit.cshtml | 3 +- .../Views/BookingPartners/Index.cshtml | 12 +- 19 files changed, 96 insertions(+), 145 deletions(-) diff --git a/.gitignore b/.gitignore index 07370c31..c83e3a48 100644 --- a/.gitignore +++ b/.gitignore @@ -333,3 +333,6 @@ ASALocalRun/ # MacOS .DS_Store + +# Fake database +*fakedatabase.db diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Account/AccountController.cs b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Account/AccountController.cs index 789d167f..46b159c8 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Account/AccountController.cs +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Account/AccountController.cs @@ -9,7 +9,6 @@ using IdentityServer4.Models; using IdentityServer4.Services; using IdentityServer4.Stores; -using IdentityServer4.Test; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Client/ClientRegistrationController.cs b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Client/ClientRegistrationController.cs index b974de5f..80cf3669 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Client/ClientRegistrationController.cs +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Client/ClientRegistrationController.cs @@ -1,18 +1,11 @@ using IdentityModel; -using IdentityServer4.Events; -using IdentityServer4.Extensions; using IdentityServer4.Models; using IdentityServer4.Stores; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Primitives; using OpenActive.FakeDatabase.NET; using System; -using System.Collections.Generic; using System.Linq; -using System.Numerics; -using System.Security.Cryptography; -using System.Text; using System.Text.Json.Serialization; using System.Threading.Tasks; @@ -23,11 +16,11 @@ namespace IdentityServer // [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] [Consumes("application/json")] [Produces("application/json")] - public class ClientResistrationController : ControllerBase + public class ClientRegistrationController : ControllerBase { private readonly IClientStore _clients; - public ClientResistrationController(IClientStore clients) + public ClientRegistrationController(IClientStore clients) { _clients = clients; } @@ -38,34 +31,23 @@ public ClientResistrationController(IClientStore clients) [ProducesResponseType(StatusCodes.Status400BadRequest)] public async Task PostAsync([FromBody] ClientRegistrationModel model) { - if (model.GrantTypes == null) - { - model.GrantTypes = new[] { OidcConstants.GrantTypes.AuthorizationCode, OidcConstants.GrantTypes.RefreshToken }; - } + model.GrantTypes ??= new[] {OidcConstants.GrantTypes.AuthorizationCode, OidcConstants.GrantTypes.RefreshToken}; if (model.GrantTypes.Any(x => x == OidcConstants.GrantTypes.Implicit) || model.GrantTypes.Any(x => x == OidcConstants.GrantTypes.AuthorizationCode)) { if (!model.RedirectUris.Any()) - { return BadRequest("A redirect URI is required for the supplied grant type."); - } if (model.RedirectUris.Any(redirectUri => !Uri.IsWellFormedUriString(redirectUri, UriKind.Absolute))) - { return BadRequest("One or more of the redirect URIs are invalid."); - } } // generate a secret for the client var key = KeyGenerator.GenerateSecret(); - - StringValues headerValues; var registrationKey = string.Empty; - if (Request.Headers.TryGetValue("Authorization", out headerValues)) - { + if (Request.Headers.TryGetValue("Authorization", out var headerValues)) registrationKey = headerValues.FirstOrDefault().Substring("Bearer ".Length); - } // update the booking system var bookingPartner = FakeBookingSystem.Database.GetBookingPartnerByInitialAccessToken(registrationKey); @@ -75,7 +57,7 @@ public async Task PostAsync([FromBody] ClientRegistrationModel mo bookingPartner.Registered = true; bookingPartner.ClientSecret = key.Sha256(); bookingPartner.Name = model.ClientName; - bookingPartner.ClientProperties = new OpenActive.FakeDatabase.NET.ClientModel + bookingPartner.ClientProperties = new ClientModel { ClientUri = model.ClientUri, LogoUri = model.LogoUri, @@ -83,14 +65,14 @@ public async Task PostAsync([FromBody] ClientRegistrationModel mo RedirectUris = model.RedirectUris, Scope = model.Scope, }; + FakeBookingSystem.Database.SaveBookingPartner(bookingPartner); // Read the updated client from the database and reflect back in the request var client = await _clients.FindClientByIdAsync(bookingPartner.ClientId); if (bookingPartner.ClientSecret != client.ClientSecrets?.FirstOrDefault()?.Value) - { return Problem(title: "New client secret not updated in cache", statusCode: 500); - } + var response = new ClientRegistrationResponse { ClientId = client.ClientId, @@ -103,7 +85,8 @@ public async Task PostAsync([FromBody] ClientRegistrationModel mo Scope = string.Join(' ', client.AllowedScopes) }; - return CreatedAtAction("ClientRegistration", response); + var baseUrl = $"{Request.Scheme}://{Request.Host.Value}/connect/register"; + return Created($"{baseUrl}/{client.ClientId}", response); } } @@ -122,7 +105,7 @@ public class ClientRegistrationModel public string[] GrantTypes { get; set; } [JsonPropertyName(OidcConstants.ClientMetadata.RedirectUris)] - public string[] RedirectUris { get; set; } = new string[] {}; + public string[] RedirectUris { get; set; } = {}; public string Scope { get; set; } = "openid profile email"; } diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Client/ClientStore.cs b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Client/ClientStore.cs index 720b7990..06825f37 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Client/ClientStore.cs +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Client/ClientStore.cs @@ -1,8 +1,6 @@ using IdentityServer4.Models; using IdentityServer4.Stores; -using Microsoft.Extensions.Logging; using OpenActive.FakeDatabase.NET; -using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -14,7 +12,7 @@ public class ClientStore : IClientStore public Task FindClientByIdAsync(string clientId) { var bookingPartner = FakeBookingSystem.Database.GetBookingPartner(clientId); - return Task.FromResult(this.ConvertToIS4Client(bookingPartner)); + return Task.FromResult(ConvertToIS4Client(bookingPartner)); } private Client ConvertToIS4Client(BookingPartnerTable bookingPartner) diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Grants/BookingPartnerViewModel.cs b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Grants/BookingPartnerViewModel.cs index 26cb3e2e..9150fc24 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Grants/BookingPartnerViewModel.cs +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Grants/BookingPartnerViewModel.cs @@ -1,7 +1,6 @@ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. - using OpenActive.FakeDatabase.NET; using System; using System.Collections.Generic; @@ -25,5 +24,4 @@ public class BookingPartnerModel public IEnumerable ApiGrantNames { get; set; } public BookingPartnerTable BookingPartner { get; set; } } - } \ No newline at end of file diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Grants/BookingPartnersController.cs b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Grants/BookingPartnersController.cs index 1915f813..53814304 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Grants/BookingPartnersController.cs +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Grants/BookingPartnersController.cs @@ -1,21 +1,16 @@ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. - using IdentityServer4.Services; using IdentityServer4.Stores; using Microsoft.AspNetCore.Mvc; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using IdentityServer4.Events; using IdentityServer4.Extensions; using OpenActive.FakeDatabase.NET; -using System.Security.Cryptography; using System; -using IdentityServer4.Models; -using System.Text.RegularExpressions; +using System.Linq; using IdentityServer; namespace src @@ -29,17 +24,12 @@ public class BookingPartnersController : Controller { private readonly IIdentityServerInteractionService _interaction; private readonly IClientStore _clients; - private readonly IResourceStore _resources; private readonly IEventService _events; - public BookingPartnersController(IIdentityServerInteractionService interaction, - IClientStore clients, - IResourceStore resources, - IEventService events) + public BookingPartnersController(IIdentityServerInteractionService interaction, IClientStore clients, IEventService events) { _interaction = interaction; _clients = clients; - _resources = resources; _events = events; } @@ -47,19 +37,21 @@ public BookingPartnersController(IIdentityServerInteractionService interaction, /// Show list of grants /// [HttpGet] - public async Task Index() + public IActionResult Index() { - return View("Index", await BuildViewModelAsync()); + return View("Index", BuildViewModel()); } /// /// Show list of grants /// [HttpGet] - public async Task Edit(string Id) + public IActionResult Edit(string id) { - var content = await BuildBookingPartnerViewModelAsync(Id); - if (content == null) return NotFound(); + var content = BuildBookingPartnerViewModel(id); + if (content == null) + return NotFound(); + return View("BookingPartnerEdit", content); } @@ -77,9 +69,9 @@ public async Task Create() /// [HttpPost] [ValidateAntiForgeryToken] - public async Task CreateBookingPartner(string email, string bookingPartnerName) + public IActionResult CreateBookingPartner(string email, string bookingPartnerName) { - var newBookingPartner = new BookingPartnerTable() + var newBookingPartner = new BookingPartnerTable { ClientId = Guid.NewGuid().ToString(), Name = bookingPartnerName, @@ -94,7 +86,27 @@ public async Task CreateBookingPartner(string email, string booki FakeBookingSystem.Database.AddBookingPartner(newBookingPartner); - return View("BookingPartnerEdit", await BuildBookingPartnerViewModelAsync(newBookingPartner.ClientId)); + return View("BookingPartnerEdit", BuildBookingPartnerViewModel(newBookingPartner.ClientId)); + } + + /// + /// Handle postback to revoke a client + /// + [HttpPost] + [ValidateAntiForgeryToken] + public IActionResult ManageKeys(string clientId) + { + return RedirectToAction("Index"); + } + + /// + /// Handle postback to revoke a client + /// + [HttpPost] + [ValidateAntiForgeryToken] + public IActionResult Restore(string clientId) + { + return RedirectToAction("Index"); } /// @@ -121,12 +133,7 @@ public async Task Suspend(string clientId) client.AllowedScopes.Remove("openactive-openbooking"); await _events.RaiseAsync(new GrantsRevokedEvent(User.GetSubjectId(), clientId)); - FakeBookingSystem.Database.UpdateBookingPartnerScope( - clientId, - "openid profile openactive-ordersfeed", - true - ); - + FakeBookingSystem.Database.UpdateBookingPartnerScope(clientId, "openid profile openactive-ordersfeed", true); return RedirectToAction("Index"); } @@ -135,12 +142,12 @@ public async Task Suspend(string clientId) /// [HttpPost] [ValidateAntiForgeryToken] - public async Task RegenerateKey(string clientId) + public IActionResult RegenerateKey(string clientId) { var bookingPartner = FakeBookingSystem.Database.GetBookingPartner(clientId); FakeBookingSystem.Database.SetBookingPartnerKey(clientId, KeyGenerator.GenerateInitialAccessToken(bookingPartner.Name)); - return View("BookingPartnerEdit", await BuildBookingPartnerViewModelAsync(clientId)); + return View("BookingPartnerEdit", BuildBookingPartnerViewModel(clientId)); } /// @@ -148,7 +155,7 @@ public async Task RegenerateKey(string clientId) /// [HttpPost] [ValidateAntiForgeryToken] - public async Task RegenerateAllKeys(string clientId) + public IActionResult RegenerateAllKeys(string clientId) { var bookingPartner = FakeBookingSystem.Database.GetBookingPartner(clientId); FakeBookingSystem.Database.ResetBookingPartnerKey(clientId, KeyGenerator.GenerateInitialAccessToken(bookingPartner.Name)); @@ -157,17 +164,17 @@ public async Task RegenerateAllKeys(string clientId) //var client = await _clients.FindClientByIdAsync(clientId); //client.ClientSecrets = new List() { new Secret(clientSecret.Sha256()) }; - return View("BookingPartnerEdit", await BuildBookingPartnerViewModelAsync(clientId)); + return View("BookingPartnerEdit", BuildBookingPartnerViewModel(clientId)); } - private async Task BuildBookingPartnerViewModelAsync(string clientId) + private static BookingPartnerModel BuildBookingPartnerViewModel(string clientId) { // var client = await _clients.FindClientByIdAsync(clientId); var bookingPartner = FakeBookingSystem.Database.GetBookingPartner(clientId); + if (bookingPartner == null) + return null; - if (bookingPartner == null) return null; - - return new BookingPartnerModel() + return new BookingPartnerModel { ClientId = bookingPartner.ClientId, ClientName = bookingPartner.Name, @@ -176,28 +183,19 @@ private async Task BuildBookingPartnerViewModelAsync(string BookingPartner = bookingPartner }; } - private async Task BuildViewModelAsync() + private static BookingPartnerViewModel BuildViewModel() { var bookingPartners = FakeBookingSystem.Database.GetBookingPartners(); - var list = new List(); - foreach (var bookingPartner in bookingPartners) + var list = bookingPartners.Select(bookingPartner => new BookingPartnerModel { - var item = new BookingPartnerModel() - { - ClientId = bookingPartner.ClientId, - ClientName = bookingPartner.Name, - ClientLogoUrl = bookingPartner.ClientProperties?.LogoUri, - ClientUrl = bookingPartner.ClientProperties?.ClientUri, - BookingPartner = bookingPartner - }; - - list.Add(item); - } - - return new BookingPartnerViewModel - { - BookingPartners = list - }; + ClientId = bookingPartner.ClientId, + ClientName = bookingPartner.Name, + ClientLogoUrl = bookingPartner.ClientProperties?.LogoUri, + ClientUrl = bookingPartner.ClientProperties?.ClientUri, + BookingPartner = bookingPartner + }).ToList(); + + return new BookingPartnerViewModel { BookingPartners = list }; } } } \ No newline at end of file diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Grants/PersistedGrantStore.cs b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Grants/PersistedGrantStore.cs index 9408faa6..becbcf2d 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Grants/PersistedGrantStore.cs +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Grants/PersistedGrantStore.cs @@ -1,7 +1,6 @@ using IdentityServer4.Models; using IdentityServer4.Stores; using OpenActive.FakeDatabase.NET; -using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -13,21 +12,17 @@ public class AcmePersistedGrantStore : IPersistedGrantStore public Task> GetAllAsync(string subjectId) { var grants = FakeBookingSystem.Database.GetAllGrants(subjectId); - - List persistedGrants = new List(); - foreach(var grant in grants) + var persistedGrants = grants.Select(grant => new PersistedGrant { - persistedGrants.Add(new PersistedGrant() - { - Key = grant.Key, - Type = grant.Type, - SubjectId = grant.SubjectId, - ClientId = grant.ClientId, - CreationTime = grant.CreationTime, - Expiration = grant.Expiration, - Data = grant.Data - }); - } + Key = grant.Key, + Type = grant.Type, + SubjectId = grant.SubjectId, + ClientId = grant.ClientId, + CreationTime = grant.CreationTime, + Expiration = grant.Expiration, + Data = grant.Data + }).ToList(); + return Task.FromResult>(persistedGrants); } @@ -47,24 +42,28 @@ public Task GetAsync(string key) } : null); } - public async Task RemoveAllAsync(string subjectId, string clientId) + public Task RemoveAllAsync(string subjectId, string clientId) { FakeBookingSystem.Database.RemoveGrant(subjectId, clientId); + return Task.CompletedTask; } - public async Task RemoveAllAsync(string subjectId, string clientId, string type) + public Task RemoveAllAsync(string subjectId, string clientId, string type) { FakeBookingSystem.Database.RemoveGrant(subjectId, clientId, type); + return Task.CompletedTask; } - public async Task RemoveAsync(string key) + public Task RemoveAsync(string key) { FakeBookingSystem.Database.RemoveGrant(key); + return Task.CompletedTask; } - public async Task StoreAsync(PersistedGrant grant) + public Task StoreAsync(PersistedGrant grant) { FakeBookingSystem.Database.AddGrant(grant.Key, grant.Type, grant.SubjectId, grant.ClientId, grant.CreationTime, grant.Expiration, grant.Data); + return Task.CompletedTask; } } } diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Profile/ProfileService.cs b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Profile/ProfileService.cs index 510b6a4e..e0833ac1 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Profile/ProfileService.cs +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Profile/ProfileService.cs @@ -1,13 +1,8 @@ using IdentityServer4.Extensions; using IdentityServer4.Models; using IdentityServer4.Services; -using IdentityServer4.Test; -using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; using System.Linq; -using System.Security.Claims; using System.Threading.Tasks; namespace IdentityServer diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Resources/Config.cs b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Resources/Config.cs index 0b7b2bac..0e949d76 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Resources/Config.cs +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Resources/Config.cs @@ -3,7 +3,6 @@ using IdentityModel; -using IdentityServer4; using IdentityServer4.Models; using System.Collections.Generic; diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Resources/CustomIdentityResource.cs b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Resources/CustomIdentityResource.cs index b4f87edb..d5ae5b43 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Resources/CustomIdentityResource.cs +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Resources/CustomIdentityResource.cs @@ -1,8 +1,5 @@ using IdentityServer4.Models; -using System; using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace IdentityServer { diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/Extensions.cs b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/Extensions.cs index 8ebf91c5..358a7df1 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/Extensions.cs +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/Extensions.cs @@ -1,8 +1,4 @@ using Microsoft.Extensions.DependencyInjection; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace IdentityServer { diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/Interfaces.cs b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/Interfaces.cs index d81a4d1f..2a3073f0 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/Interfaces.cs +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/Interfaces.cs @@ -1,10 +1,4 @@ -using OpenActive.FakeDatabase.NET; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace IdentityServer +namespace IdentityServer { public interface IUserRepository { diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/ResourceOwnerPasswordValidator.cs b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/ResourceOwnerPasswordValidator.cs index 95224345..40010d99 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/ResourceOwnerPasswordValidator.cs +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/ResourceOwnerPasswordValidator.cs @@ -1,8 +1,5 @@ using IdentityModel; using IdentityServer4.Validation; -using System; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; namespace IdentityServer diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/UserRepository.cs b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/UserRepository.cs index 09a9bcc8..ea8e88f8 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/UserRepository.cs +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Custom/Users/UserRepository.cs @@ -1,10 +1,6 @@ -using IdentityModel; -using OpenActive.FakeDatabase.NET; -using System; +using OpenActive.FakeDatabase.NET; using System.Collections.Generic; -using System.Linq; using System.Security.Claims; -using System.Threading.Tasks; namespace IdentityServer { diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Program.cs b/Examples/BookingSystem.AspNetCore.IdentityServer/Program.cs index 8c6d9a5d..e5fb8053 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Program.cs +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Program.cs @@ -43,7 +43,7 @@ public static int Main(string[] args) } catch (Exception ex) { - Log.Fatal(ex, "Host terminated unexpectedly."); + Log.Fatal(ex, "Host terminated unexpectedly"); return 1; } finally diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Startup.cs b/Examples/BookingSystem.AspNetCore.IdentityServer/Startup.cs index b759c40f..aaf3bebf 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Startup.cs +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Startup.cs @@ -1,15 +1,12 @@ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. - -using IdentityServer4.Services; using IdentityServer4.Stores; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Configuration; -using src; namespace IdentityServer { diff --git a/Examples/BookingSystem.AspNetCore.IdentityServer/Views/BookingPartners/BookingPartnerCreate.cshtml b/Examples/BookingSystem.AspNetCore.IdentityServer/Views/BookingPartners/BookingPartnerCreate.cshtml index b010dae8..e94a7db3 100644 --- a/Examples/BookingSystem.AspNetCore.IdentityServer/Views/BookingPartners/BookingPartnerCreate.cshtml +++ b/Examples/BookingSystem.AspNetCore.IdentityServer/Views/BookingPartners/BookingPartnerCreate.cshtml @@ -1,7 +1,6 @@ @model BookingPartnerModel -@using System; -
+