Skip to content

Commit

Permalink
Release/6.0.0 (#4)
Browse files Browse the repository at this point in the history
* Migrate to latest IS4

Signed-off-by: SalifovEA <[email protected]>

* Remove hardcoded connection string

Signed-off-by: SalifovEA <[email protected]>

* Update version, Log level and readme

Signed-off-by: SalifovEA <[email protected]>

* Downgrade DependencyInjection.Abstractions reference version

Signed-off-by: SalifovEA <[email protected]>

* Update readme.md

* Update .appveyor.yml

* Update cake. Fix breaking changes.

* Adjust to use VS2019.

* Update owner, repo name, package properties.

* Fix repo url.

* Fix misprint.

* Update readme.md

* Update IdentityServer4.Contrib.Membership.csproj

Co-authored-by: wwwlicious <[email protected]>
Co-authored-by: SalifovEA <[email protected]>
  • Loading branch information
3 people authored Mar 25, 2021
1 parent d5d0255 commit fb3c515
Show file tree
Hide file tree
Showing 70 changed files with 282 additions and 3,029 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Build Script #
#---------------------------------#
build_script:
- ps: .\build.ps1 -Target AppVeyor --settings_skipverification=true
- ps: .\build.ps1 --Target AppVeyor --settings_skipverification=true


# Tests
Expand Down Expand Up @@ -30,4 +30,4 @@ cache:
#---------------------------------#

# Build worker image (VM template)
image: Visual Studio 2017
image: Visual Studio 2019
25 changes: 13 additions & 12 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#tool "nuget:?package=xunit.runner.console&version=2.3.1"
#tool "nuget:?package=GitVersion.CommandLine&version=3.6.5"
#tool "nuget:?package=GitVersion.CommandLine&version=5.6.6"
#tool "nuget:?package=gitreleasemanager&version=0.7.1"
#tool "nuget:?package=gitlink&version=2.4.0"
#addin "nuget:?package=Cake.Incubator&version=3.0.0"
#addin "nuget:?package=Cake.Incubator&version=6.0.0"

///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
///////////////////////////////////////////////////////////////////////////////
var envBuildNumber = EnvironmentVariable<int>("APPVEYOR_BUILD_NUMBER", 0);
var gitHubUserName = EnvironmentVariable("GITHUB_USERNAME");
var gitHubPassword = EnvironmentVariable("GITHUB_PASSWORD");
var githubAccessToken = EnvironmentVariable("GITHUB_ACCESS_TOKEN");
var nugetSourceUrl = EnvironmentVariable("NUGET_SOURCE");
var nugetApiKey = EnvironmentVariable("NUGET_API_KEY");

Expand All @@ -30,8 +31,8 @@ var releaseNotesPath = rootPath.CombineWithFilePath("CHANGELOG.md");

// project specific
var solutionFile = srcDir + File("IdentityServer.Contrib.Membership.sln");
var gitHubRepositoryOwner = "sma73648";
var gitHubRepositoryName = "identityserver-contrib-membership";
var gitHubRepositoryOwner = "Sitecore";
var gitHubRepositoryName = "sitecore-identityserver-contrib-membership";

var isLocalBuild = BuildSystem.IsLocalBuild;
var isPullRequest = BuildSystem.AppVeyor.Environment.PullRequest.IsPullRequest;
Expand All @@ -41,8 +42,8 @@ var isHotFixBranch = BuildSystem.AppVeyor.Environment.Repository.Branch.StartsWi
var isTagged = BuildSystem.AppVeyor.Environment.Repository.Tag.IsTag && !BuildSystem.AppVeyor.Environment.Repository.Tag.Name.IsNullOrEmpty();
var publishingError = false;

var shouldPublishNuGet = (!isLocalBuild && !isPullRequest && (isMasterBranch || isReleaseBranch || isHotFixBranch) && isTagged);
var shouldPublishGitHub = shouldPublishNuGet;
var shouldPublishNuGet = false;
var shouldPublishGitHub = (!isLocalBuild && !isPullRequest && (isMasterBranch || isReleaseBranch || isHotFixBranch) && isTagged);

var gitVersionResults = GitVersion(new GitVersionSettings { UpdateAssemblyInfo = false });
var semVersion = $"{gitVersionResults.MajorMinorPatch}.{buildNumber}";
Expand Down Expand Up @@ -98,7 +99,7 @@ Task("Build")
.WithProperty("Version", semVersion)
.WithProperty("PackageVersion", gitVersionResults.MajorMinorPatch)
.WithProperty("PackageOutputPath", MakeAbsolute(nugetPackageDir).FullPath)
.UseToolVersion(MSBuildToolVersion.VS2017)
.UseToolVersion(MSBuildToolVersion.VS2019)
.SetNodeReuse(false);
// setup binary logging for solution to artifacts dir
Expand Down Expand Up @@ -139,7 +140,7 @@ Task("Create-Release-Notes")
Information("Creating release notes for {0}", semVersion);
gitHubUserName.ThrowIfNull(nameof(gitHubUserName));
gitHubPassword.ThrowIfNull(nameof(gitHubPassword));
GitReleaseManagerCreate(gitHubUserName, gitHubPassword, gitHubRepositoryOwner, gitHubRepositoryName, new GitReleaseManagerCreateSettings {
GitReleaseManagerCreate(githubAccessToken, gitHubRepositoryOwner, gitHubRepositoryName, new GitReleaseManagerCreateSettings {
Milestone = gitVersionResults.MajorMinorPatch,
Name = gitVersionResults.MajorMinorPatch,
Prerelease = false,
Expand All @@ -157,7 +158,7 @@ Task("Export-Release-Notes")
gitHubUserName.ThrowIfNull(nameof(gitHubUserName));
gitHubPassword.ThrowIfNull(nameof(gitHubPassword));
GitReleaseManagerExport(gitHubUserName, gitHubPassword, gitHubRepositoryOwner, gitHubRepositoryName, releaseNotesPath,
GitReleaseManagerExport(githubAccessToken, gitHubRepositoryOwner, gitHubRepositoryName, releaseNotesPath,
new GitReleaseManagerExportSettings {
TagName = gitVersionResults.MajorMinorPatch
});
Expand All @@ -174,11 +175,11 @@ Task("Publish-GitHub-Release")
// upload packages as assets
foreach(var package in GetFiles(nugetPackageDir.Path + "/*"))
{
GitReleaseManagerAddAssets(gitHubUserName, gitHubPassword, gitHubRepositoryOwner, gitHubRepositoryName, gitVersionResults.MajorMinorPatch, package.ToString());
GitReleaseManagerAddAssets(githubAccessToken, gitHubRepositoryOwner, gitHubRepositoryName, gitVersionResults.MajorMinorPatch, package.ToString());
}
// close the release
GitReleaseManagerClose(gitHubUserName, gitHubPassword, gitHubRepositoryOwner, gitHubRepositoryName, gitVersionResults.MajorMinorPatch);
GitReleaseManagerClose(githubAccessToken, gitHubRepositoryOwner, gitHubRepositoryName, gitVersionResults.MajorMinorPatch);
});

Task("Publish-Nuget-Packages")
Expand Down Expand Up @@ -230,4 +231,4 @@ Task("Clean")
});
});

RunTarget(target);
RunTarget(target);
70 changes: 12 additions & 58 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,75 +1,29 @@
# IdentityServer3.Contrib.Membership
# Sitecore.IdentityServer4.Contrib.Membership

[![Build status](https://ci.appveyor.com/api/projects/status/avdpiba1rj8ce59h/branch/master?svg=true)](https://ci.appveyor.com/project/wwwlicious/identityserver-contrib-membership/branch/master)
[![NuGet version](https://badge.fury.io/nu/IdentityServer3.Contrib.Membership.svg)](https://badge.fury.io/nu/IdentityServer3.Contrib.Membership)
[![Build status](https://ci.appveyor.com/api/projects/status/4ifi93bfr7rl9p3l/branch/develop?svg=true)](https://ci.appveyor.com/project/sc-alexandernaumchenkov/sitecore-identityserver-contrib-membership/branch/develop)

## ASP.NET 2.0 Membership Database as Identity Server User Store
Identity Server is a framework and doesn't provide implementations of user data sources out of the box.
If you have an existing ASP.NET 2.0 Membership Database containing user data for existing systems then you can install the following package:

```powershell
PM> Install-Package IdentityServer3.Contrib.Membership
PM> Install-Package Sitecore.IdentityServer4.Contrib.Membership
```

To add the plugin, add the following to the OWIN startup class of your IdentityServer instance:
```csharp
public void Configuration(IAppBuilder app)
public void ConfigureServices(IServiceCollection services)
{
var factory = new IdentityServerServiceFactory();
...
factory.UseMembershipService(
new MembershipOptions
var builder = services.AddIdentityServer(options => { })
...
.AddMembershipService(new MembershipOptions
{
ConnectionString = "...", // Membership database connection string
ApplicationName = "..." // Membership Application Name
});
...
ConnectionString = "...", // Membership database connection string
ApplicationName = "..." // Membership Application Name
})
...
}
```

This will validate user logins and passwords against an existing database. No support is provided for maintaining users and it is not recommended that you use this for a new implementation.
IdentityServer provides a [plugin](https://github.com/IdentityServer/IdentityServer3.AspNetIdentity) that supports [ASP.NET Identity](http://www.asp.net/identity).

## Overview
Project IdentityServer3.Membership is an implementation of a IUserService that authenticates against an existing ASP.NET 2.0 Membership database without having to use the SqlMembershipProvider.
To add this to the OWIN startup class of an IdentityServer instance add the following to the Configuration method:

```csharp
public void Configuration(IAppBuilder app)
{
var factory = new IdentityServerServiceFactory();

...
factory.UseMembershipService(
new MembershipOptions
{
ConnectionString = "Data Source=localhost;Initial Catalog=Membership;Integrated Security=True",
ApplicationName = "/"
});

...
}
```

## IdentityServer3.Contrib.Membership.Demo
A demo project that authenticates a [ServiceStack](https://servicestack.net/) razor-based Client App using [IdentityServer](https://identityserver.github.io/)
using an ASP.NET Membership Database for User data.

## Overview
This demo project bring in the various Identity Server and Service Stack plugins available in this Solution, namely:
* IdentityServer3.Contrib.Membership - An IdentityServer plugin that stores user data
* IdentityServer3.Contrib.ServiceStack - An IdentityServer plugin that supports impersonation authentication of a ServiceStack instance using IdentityServer
* ServiceStack.IdentityServerAuthProvider - A ServiceStack AuthProvider that authenticates a user against an IdentityServer instance

When the project starts, you should be presented with a simple ServiceStack web app with a link that redirects to a secure service in ServiceStack. When you select the link you should be redirected to the IdentityServer instance that prompts you for login details. Login using username "[email protected]" with password "password123". You should then be redirected back to the ServiceStack web app and have access to the secure service (with Authenticate attribute) which displays the secure message.

### Prerequisites
* Create a SQL Server database called "Membership" using aspnet_regsql.exe (update app.config with the correct connectionString). See below for instructions.

#### Creating an empty ASP.NET 2.0 Membership database
To create an empty ASP.NET 2.0 Membership database, run the following command:
`C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe`

When the wizard opens, select next then "Configure SQL Server for application services" then next again. Select the Server instance on which the database will run and give the Database name "Membership" then continue.

The sample code can be viewed [here](/samples/IdentityServer3.Contrib.Membership.Demo)
IdentityServer provides a [plugin](https://github.com/IdentityServer/IdentityServer4.AspNetIdentity) that supports [ASP.NET Identity](http://www.asp.net/identity).
64 changes: 23 additions & 41 deletions src/IdentityServer.Contrib.Membership.sln
Original file line number Diff line number Diff line change
@@ -1,66 +1,48 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio Version 16
VisualStudioVersion = 16.0.29806.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B48FB59C-14FC-4A91-9F1F-A26EB49FFABD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{74A6DE1B-94EA-476B-ABD5-A916A486C236}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{B32D51A2-39BF-4468-A80F-49A178D4AAC3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IdentityServer3.Contrib.Membership", "IdentityServer3.Contrib.Membership\IdentityServer3.Contrib.Membership.csproj", "{F93C0194-0A90-424E-B0CD-C3CE938D5858}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServer4.Contrib.Membership", "IdentityServer4.Contrib.Membership\IdentityServer4.Contrib.Membership.csproj", "{A50141E5-D4A3-4056-BEF9-7D2AB76E33DD}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "IdentityServer4.Contrib.Membership", "IdentityServer4.Contrib.Membership\IdentityServer4.Contrib.Membership.csproj", "{128F0DF1-A19D-4C29-95B8-D5A7AB236D9C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServer4.Contrib.Membership.IdsvrDemo", "samples\IdentityServer4.Contrib.Membership.IdsvrDemo\IdentityServer4.Contrib.Membership.IdsvrDemo.csproj", "{7B095426-9FEC-471C-9696-430A51485CD4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IdentityServer3.Contrib.Membership.Tests", "test\IdentityServer3.Contrib.Membership.Tests\IdentityServer3.Contrib.Membership.Tests.csproj", "{D8C047F2-B1AA-4B12-B6FA-DE91C3DAC907}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IdentityServer3.Contrib.Membership.Demo", "samples\IdentityServer3.Contrib.Membership.Demo\IdentityServer3.Contrib.Membership.Demo.csproj", "{7950F85F-2797-4727-BD5D-9001B79D51D4}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "IdentityServer4.Contrib.Membership.ClientDemo", "samples\IdentityServer4.Contrib.Membership.ClientDemo\IdentityServer4.Contrib.Membership.ClientDemo.csproj", "{FD726027-AC69-4049-B01F-51067F45C3A7}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "IdentityServer4.Contrib.Membership.IdsvrDemo", "samples\IdentityServer4.Contrib.Membership.IdsvrDemo\IdentityServer4.Contrib.Membership.IdsvrDemo.csproj", "{65041166-AA5A-4941-8764-3EE24166958D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServer4.Contrib.Membership.ClientDemo", "samples\IdentityServer4.Contrib.Membership.ClientDemo\IdentityServer4.Contrib.Membership.ClientDemo.csproj", "{A2A7153E-9E2A-46E9-A8C1-131B5E1AC590}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F93C0194-0A90-424E-B0CD-C3CE938D5858}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F93C0194-0A90-424E-B0CD-C3CE938D5858}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F93C0194-0A90-424E-B0CD-C3CE938D5858}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F93C0194-0A90-424E-B0CD-C3CE938D5858}.Release|Any CPU.Build.0 = Release|Any CPU
{128F0DF1-A19D-4C29-95B8-D5A7AB236D9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{128F0DF1-A19D-4C29-95B8-D5A7AB236D9C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{128F0DF1-A19D-4C29-95B8-D5A7AB236D9C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{128F0DF1-A19D-4C29-95B8-D5A7AB236D9C}.Release|Any CPU.Build.0 = Release|Any CPU
{D8C047F2-B1AA-4B12-B6FA-DE91C3DAC907}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D8C047F2-B1AA-4B12-B6FA-DE91C3DAC907}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D8C047F2-B1AA-4B12-B6FA-DE91C3DAC907}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D8C047F2-B1AA-4B12-B6FA-DE91C3DAC907}.Release|Any CPU.Build.0 = Release|Any CPU
{7950F85F-2797-4727-BD5D-9001B79D51D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7950F85F-2797-4727-BD5D-9001B79D51D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7950F85F-2797-4727-BD5D-9001B79D51D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7950F85F-2797-4727-BD5D-9001B79D51D4}.Release|Any CPU.Build.0 = Release|Any CPU
{FD726027-AC69-4049-B01F-51067F45C3A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD726027-AC69-4049-B01F-51067F45C3A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD726027-AC69-4049-B01F-51067F45C3A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FD726027-AC69-4049-B01F-51067F45C3A7}.Release|Any CPU.Build.0 = Release|Any CPU
{65041166-AA5A-4941-8764-3EE24166958D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{65041166-AA5A-4941-8764-3EE24166958D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{65041166-AA5A-4941-8764-3EE24166958D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{65041166-AA5A-4941-8764-3EE24166958D}.Release|Any CPU.Build.0 = Release|Any CPU
{A50141E5-D4A3-4056-BEF9-7D2AB76E33DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A50141E5-D4A3-4056-BEF9-7D2AB76E33DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A50141E5-D4A3-4056-BEF9-7D2AB76E33DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A50141E5-D4A3-4056-BEF9-7D2AB76E33DD}.Release|Any CPU.Build.0 = Release|Any CPU
{7B095426-9FEC-471C-9696-430A51485CD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B095426-9FEC-471C-9696-430A51485CD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B095426-9FEC-471C-9696-430A51485CD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7B095426-9FEC-471C-9696-430A51485CD4}.Release|Any CPU.Build.0 = Release|Any CPU
{A2A7153E-9E2A-46E9-A8C1-131B5E1AC590}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A2A7153E-9E2A-46E9-A8C1-131B5E1AC590}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A2A7153E-9E2A-46E9-A8C1-131B5E1AC590}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A2A7153E-9E2A-46E9-A8C1-131B5E1AC590}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F93C0194-0A90-424E-B0CD-C3CE938D5858} = {B48FB59C-14FC-4A91-9F1F-A26EB49FFABD}
{128F0DF1-A19D-4C29-95B8-D5A7AB236D9C} = {B48FB59C-14FC-4A91-9F1F-A26EB49FFABD}
{D8C047F2-B1AA-4B12-B6FA-DE91C3DAC907} = {74A6DE1B-94EA-476B-ABD5-A916A486C236}
{7950F85F-2797-4727-BD5D-9001B79D51D4} = {B32D51A2-39BF-4468-A80F-49A178D4AAC3}
{FD726027-AC69-4049-B01F-51067F45C3A7} = {B32D51A2-39BF-4468-A80F-49A178D4AAC3}
{65041166-AA5A-4941-8764-3EE24166958D} = {B32D51A2-39BF-4468-A80F-49A178D4AAC3}
{A50141E5-D4A3-4056-BEF9-7D2AB76E33DD} = {B48FB59C-14FC-4A91-9F1F-A26EB49FFABD}
{7B095426-9FEC-471C-9696-430A51485CD4} = {B32D51A2-39BF-4468-A80F-49A178D4AAC3}
{A2A7153E-9E2A-46E9-A8C1-131B5E1AC590} = {B32D51A2-39BF-4468-A80F-49A178D4AAC3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9781470E-EFA6-4282-A271-753C6C005115}
EndGlobalSection
EndGlobal

This file was deleted.

This file was deleted.

Loading

0 comments on commit fb3c515

Please sign in to comment.