mirror of
https://github.com/bitwarden/server.git
synced 2025-07-12 13:19:01 -05:00
added installation id to current context.
This commit is contained in:
@ -11,6 +11,7 @@ namespace Bit.Core
|
||||
public virtual User User { get; set; }
|
||||
public virtual string DeviceIdentifier { get; set; }
|
||||
public virtual List<CurrentContentOrganization> Organizations { get; set; } = new List<CurrentContentOrganization>();
|
||||
public virtual Guid? InstallationId { get; set; }
|
||||
|
||||
public bool OrganizationUser(Guid orgId)
|
||||
{
|
||||
|
@ -21,7 +21,7 @@ namespace Bit.Core.IdentityServer
|
||||
"orgadmin",
|
||||
"orguser"
|
||||
}),
|
||||
new ApiResource("api.push")
|
||||
new ApiResource("api.push", new string[] { JwtClaimTypes.Subject })
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ using IdentityServer4.Models;
|
||||
using System.Collections.Generic;
|
||||
using Bit.Core.Repositories;
|
||||
using System;
|
||||
using System.Security.Claims;
|
||||
using IdentityModel;
|
||||
|
||||
namespace Bit.Core.IdentityServer
|
||||
{
|
||||
@ -37,7 +39,8 @@ namespace Bit.Core.IdentityServer
|
||||
AllowedScopes = new string[] { "api.push" },
|
||||
AllowedGrantTypes = GrantTypes.ClientCredentials,
|
||||
AccessTokenLifetime = 3600 * 24,
|
||||
Enabled = installation.Enabled
|
||||
Enabled = installation.Enabled,
|
||||
Claims = new List<Claim> { new Claim(JwtClaimTypes.Subject, installation.Id.ToString()) }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user