1
0
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:
Kyle Spearrin
2017-08-10 15:26:05 -04:00
parent e538817eb6
commit 0ad76a5487
5 changed files with 55 additions and 17 deletions

View File

@ -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)
{

View File

@ -21,7 +21,7 @@ namespace Bit.Core.IdentityServer
"orgadmin",
"orguser"
}),
new ApiResource("api.push")
new ApiResource("api.push", new string[] { JwtClaimTypes.Subject })
};
}
}

View File

@ -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()) }
};
}
}