Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
270 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.0.1" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.0.1" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace IdentityCore.Library | ||
{ | ||
using Microsoft.AspNetCore.Identity; | ||
using System; | ||
|
||
public class MyIdentityRole<T> : IdentityRole<string> | ||
{ | ||
public MyIdentityRole() | ||
{ | ||
Id = Guid.NewGuid().ToString(); | ||
} | ||
|
||
public MyIdentityRole(string name) : this() | ||
{ | ||
Name = name; | ||
} | ||
|
||
public MyIdentityRole(string name, string id) | ||
{ | ||
Name = name; | ||
Id = id; | ||
} | ||
|
||
public string Description { get; internal set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace IdentityCore.Library | ||
{ | ||
using Microsoft.AspNetCore.Identity; | ||
using System; | ||
|
||
public class MyIdentityUser : IdentityUser | ||
{ | ||
public DateTime? JoinDate { get; set; } | ||
public string JobTitle { get; set; } | ||
public string Contract { get; set; } | ||
|
||
public MyIdentityUser() | ||
{ | ||
Id = Guid.NewGuid().ToString(); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
using Microsoft.AspNetCore.Identity; | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace IdentityCore.Library | ||
{ | ||
public class MyRoleStore<T> : IRoleStore<T> where T : MyIdentityRole<string> | ||
{ | ||
public Task<IdentityResult> CreateAsync(T role, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task<IdentityResult> DeleteAsync(T role, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
//throw new NotImplementedException(); | ||
} | ||
|
||
public Task<T> FindByIdAsync(string roleId, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task<T> FindByNameAsync(string normalizedRoleName, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task<string> GetNormalizedRoleNameAsync(T role, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task<string> GetRoleIdAsync(T role, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task<string> GetRoleNameAsync(T role, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task SetNormalizedRoleNameAsync(T role, string normalizedName, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task SetRoleNameAsync(T role, string roleName, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task<IdentityResult> UpdateAsync(T role, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using Microsoft.AspNetCore.Identity; | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace IdentityCore.Library | ||
{ | ||
public class MyUserStore<T> : IUserStore<T> where T : MyIdentityUser | ||
{ | ||
public Task<IdentityResult> CreateAsync(T user, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task<IdentityResult> DeleteAsync(T user, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
//throw new NotImplementedException(); | ||
} | ||
|
||
public Task<T> FindByIdAsync(string userId, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task<T> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken) | ||
{ | ||
//TODO : implement database logic to get the user by name | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task<string> GetNormalizedUserNameAsync(T user, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task<string> GetUserIdAsync(T user, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task<string> GetUserNameAsync(T user, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task SetNormalizedUserNameAsync(T user, string normalizedName, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task SetUserNameAsync(T user, string userName, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public Task<IdentityResult> UpdateAsync(T user, CancellationToken cancellationToken) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.27130.2003 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApplication", "WebApplication\WebApplication.csproj", "{ACFBC569-D489-4CF0-90D6-BA973A1EF058}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IdentityCore.Library", "IdentityCore.Library\IdentityCore.Library.csproj", "{EA25B28F-7C10-4815-9276-70E8DBEB11E9}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{ACFBC569-D489-4CF0-90D6-BA973A1EF058}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{ACFBC569-D489-4CF0-90D6-BA973A1EF058}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{ACFBC569-D489-4CF0-90D6-BA973A1EF058}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{ACFBC569-D489-4CF0-90D6-BA973A1EF058}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{EA25B28F-7C10-4815-9276-70E8DBEB11E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{EA25B28F-7C10-4815-9276-70E8DBEB11E9}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{EA25B28F-7C10-4815-9276-70E8DBEB11E9}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{EA25B28F-7C10-4815-9276-70E8DBEB11E9}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {530A232D-3D7A-4367-9825-7D79A21DCD51} | ||
EndGlobalSection | ||
EndGlobal |
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
8 changes: 4 additions & 4 deletions
8
WebApplication/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.