forked from sma73648/identityserver-contrib-membership
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
d5d0255
commit fb3c515
Showing
70 changed files
with
282 additions
and
3,029 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
40 changes: 0 additions & 40 deletions
40
src/IdentityServer3.Contrib.Membership/AppBuilderMembershipServiceExtensions.cs
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
src/IdentityServer3.Contrib.Membership/DataAccess/Entities/Membership.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.