BlazorShared and Services (#430)
* Service to Services * Change Shared project to BlazorShared * change refrerances to BlazorShared
This commit is contained in:
22
src/BlazorShared/Authorization/ClaimValue.cs
Normal file
22
src/BlazorShared/Authorization/ClaimValue.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace BlazorShared.Authorization
|
||||
{
|
||||
public class ClaimValue
|
||||
{
|
||||
public ClaimValue()
|
||||
{
|
||||
}
|
||||
|
||||
public ClaimValue(string type, string value)
|
||||
{
|
||||
Type = type;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public string Type { get; set; }
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
||||
14
src/BlazorShared/Authorization/Constants.cs
Normal file
14
src/BlazorShared/Authorization/Constants.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace BlazorShared.Authorization
|
||||
{
|
||||
public class Constants
|
||||
{
|
||||
public static class Roles
|
||||
{
|
||||
public const string ADMINISTRATORS = "Administrators";
|
||||
}
|
||||
}
|
||||
}
|
||||
16
src/BlazorShared/Authorization/UserInfo.cs
Normal file
16
src/BlazorShared/Authorization/UserInfo.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
|
||||
namespace BlazorShared.Authorization
|
||||
{
|
||||
public class UserInfo
|
||||
{
|
||||
public static readonly UserInfo Anonymous = new UserInfo();
|
||||
public bool IsAuthenticated { get; set; }
|
||||
public string NameClaimType { get; set; }
|
||||
public string RoleClaimType { get; set; }
|
||||
public IEnumerable<ClaimValue> Claims { get; set; }
|
||||
}
|
||||
}
|
||||
9
src/BlazorShared/BlazorShared.csproj
Normal file
9
src/BlazorShared/BlazorShared.csproj
Normal file
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<RootNamespace>BlazorShared</RootNamespace>
|
||||
<AssemblyName>BlazorShared</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user