Skip to content

Commit

Permalink
Migrate to Duende server (#6)
Browse files Browse the repository at this point in the history
* Upgrade to Duende Server 6.0.4
  • Loading branch information
sc-alexandernaumchenkov committed Apr 11, 2022
1 parent fb3c515 commit 031b105
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace IdentityServer4.Contrib.Membership
using DataAccess;
using Interfaces;
using Microsoft.Extensions.DependencyInjection;
using Services;
using Duende.IdentityServer.Services;

public static class AppBuilderMembershipServiceExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

namespace IdentityServer4.Contrib.Membership.Helpers
{
using System.Security.Claims;
using Duende.IdentityServer;

public static class MembershipUserExtensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<Copyright>Copyright © 2017 onwards</Copyright>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Configurations>Debug;Release</Configurations>
<RootNamespace>IdentityServer4.Contrib.Membership</RootNamespace>
<PackageId>Sitecore.IdentityServer4.Contrib.Membership</PackageId>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageProjectUrl>>https://github.com/Sitecore/sitecore-identityserver-contrib-membership</PackageProjectUrl>
<PackageProjectUrl>https://github.com/Sitecore/sitecore-identityserver-contrib-membership</PackageProjectUrl>
<PackageLicenseUrl>https://www.mozilla.org/en-US/MPL/2.0/</PackageLicenseUrl>
<PackageIconUrl>https://identityserver.github.io/Documentation/assets/images/icons/IDserver_icon128.jpg</PackageIconUrl>
<RepositoryUrl>https://github.com/Sitecore/sitecore-identityserver-contrib-membership</RepositoryUrl>
Expand All @@ -22,7 +22,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="IdentityServer4" Version="4.1.1" />
<PackageReference Include="Duende.IdentityServer" Version="6.0.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.5" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

namespace IdentityServer4.Contrib.Membership
{
using System;
using System.Linq;
using System.Threading.Tasks;
using Helpers;
using Interfaces;
using Models;
using Services;
using Extensions;
using Duende.IdentityServer.Extensions;
using Duende.IdentityServer.Models;
using Duende.IdentityServer.Services;
using IMembershipClaimsService = Interfaces.IMembershipClaimsService;

/// <summary>
/// Implementation of the Identity Server 4 Profile Service <see cref="IdentityServer4.Services.IProfileService"/>
/// Implementation of the Identity Server 4 Profile Service <see cref="Duende.IdentityServer.Services.IProfileService"/>
/// that queries the Membership Database in order to transform the Membership Data into Claims
/// </summary>
public class MembershipProfileService : IProfileService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

namespace IdentityServer4.Contrib.Membership.IdsvrDemo.Controllers
{
using System.Security.Claims;
using System.Text.Encodings.Web;
using System.Threading.Tasks;
using Helpers;
using IdentityServer4.Models;
using Interfaces;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Models;
using Services;
using Stores;
using System;
using Duende.IdentityServer;
using Duende.IdentityServer.Models;
using Duende.IdentityServer.Services;
using Duende.IdentityServer.Stores;

/// <summary>
/// This is a sample login controller taken from the original IdentityServer4 <a href="https://github.com/IdentityServer/IdentityServer4.Samples/">Samples.</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

namespace IdentityServer4.Contrib.Membership.IdsvrDemo.Controllers
{
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Models;
using Services;
using Duende.IdentityServer.Services;

/// <summary>
/// This is a sample home controller taken from the original IdentityServer4 <a href="https://github.com/IdentityServer/IdentityServer4.Samples/">Samples.</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

namespace IdentityServer4.Contrib.Membership.IdsvrDemo.Models
{
using IdentityServer4.Models;
using Duende.IdentityServer.Models;

public class ErrorViewModel
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
using System.Collections.Generic;
using Duende.IdentityServer;
using IdentityModel;
using IdentityServer4.Models;
using Duende.IdentityServer.Models;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
Expand Down Expand Up @@ -117,9 +118,9 @@ public static List<IdentityResource> Get()
{
return new List<IdentityResource>
{
new IdentityServer4.Models.IdentityResources.OpenId(),
new IdentityServer4.Models.IdentityResources.Profile(),
new IdentityServer4.Models.IdentityResources.Email(),
new Duende.IdentityServer.Models.IdentityResources.OpenId(),
new Duende.IdentityServer.Models.IdentityResources.Profile(),
new Duende.IdentityServer.Models.IdentityResources.Email(),
new IdentityResource
{
Name = "ServiceStack.SelfHost",
Expand Down

0 comments on commit 031b105

Please sign in to comment.