mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 16:42:50 -05:00
PM-10600: Added DeviceType claim
This commit is contained in:
@ -162,6 +162,11 @@ public class CurrentContext : ICurrentContext
|
||||
|
||||
DeviceIdentifier = GetClaimValue(claimsDict, Claims.Device);
|
||||
|
||||
if (Enum.TryParse(GetClaimValue(claimsDict, Claims.DeviceType), out DeviceType deviceType))
|
||||
{
|
||||
DeviceType = deviceType;
|
||||
}
|
||||
|
||||
Organizations = GetOrganizations(claimsDict, orgApi);
|
||||
|
||||
Providers = GetProviders(claimsDict);
|
||||
|
@ -6,6 +6,7 @@ public static class Claims
|
||||
public const string SecurityStamp = "sstamp";
|
||||
public const string Premium = "premium";
|
||||
public const string Device = "device";
|
||||
public const string DeviceType = "devicetype";
|
||||
|
||||
public const string OrganizationOwner = "orgowner";
|
||||
public const string OrganizationAdmin = "orgadmin";
|
||||
|
@ -18,6 +18,7 @@ public class ApiResources
|
||||
Claims.SecurityStamp,
|
||||
Claims.Premium,
|
||||
Claims.Device,
|
||||
Claims.DeviceType,
|
||||
Claims.OrganizationOwner,
|
||||
Claims.OrganizationAdmin,
|
||||
Claims.OrganizationUser,
|
||||
|
@ -205,6 +205,7 @@ public abstract class BaseRequestValidator<T> where T : class
|
||||
if (device != null)
|
||||
{
|
||||
claims.Add(new Claim(Claims.Device, device.Identifier));
|
||||
claims.Add(new Claim(Claims.DeviceType, device.Type.ToString()));
|
||||
}
|
||||
|
||||
var customResponse = new Dictionary<string, object>();
|
||||
|
Reference in New Issue
Block a user