Skip to content

Commit

Permalink
reactor: Remove PSSO code
Browse files Browse the repository at this point in the history
  • Loading branch information
wzh425 committed Mar 29, 2024
1 parent fe43666 commit 4b5d41d
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 357 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageReference Include="FluentValidation" Version="11.4.0" />
<PackageReference Include="Magicodes.IE.Csv" Version="2.6.4" />
<PackageReference Include="Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain" Version="$(MasaFrameworkPackageVersion)" />
<PackageReference Include="Masa.BuildingBlocks.Authentication.OpenIdConnect.Models" Version="1.0.1-preview.10.3" />
<PackageReference Include="Masa.BuildingBlocks.Authentication.OpenIdConnect.Models" Version="1.0.1-preview.10.4" />
<PackageReference Include="Masa.BuildingBlocks.StackSdks.Auth.Contracts" Version="1.0.1-preview.10.3" />
<!--<PackageReference Include="Masa.BuildingBlocks.StackSdks.Auth.Contracts" Version="$(MasaFrameworkPackageVersion)" />-->
<PackageReference Include="Masa.Contrib.Configuration.ConfigurationApi.Dcc" Version="$(MasaFrameworkPackageVersion)" />
Expand Down
13 changes: 0 additions & 13 deletions src/Contracts/Masa.Auth.Contracts.Admin/Psso/AbpApiResponse.cs

This file was deleted.

45 changes: 0 additions & 45 deletions src/Contracts/Masa.Auth.Contracts.Admin/Psso/AssignedRoleDto.cs

This file was deleted.

50 changes: 0 additions & 50 deletions src/Contracts/Masa.Auth.Contracts.Admin/Psso/FeatureTreeDto.cs

This file was deleted.

This file was deleted.

This file was deleted.

43 changes: 0 additions & 43 deletions src/Contracts/Masa.Auth.Contracts.Admin/Psso/GetUserInfoOutput.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2482,7 +2482,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();

b.OwnsOne("Masa.Auth.Service.Admin.Domain.Subjects.Aggregates.AddressValue", "Address", b1 =>
b.OwnsOne("Masa.Auth.Service.Admin.Domain.Subjects.Aggregates.Staff.Address#Masa.Auth.Service.Admin.Domain.Subjects.Aggregates.AddressValue", "Address", b1 =>
{
b1.Property<Guid>("StaffId")
.HasColumnType("uniqueidentifier");
Expand Down Expand Up @@ -2523,7 +2523,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

modelBuilder.Entity("Masa.Auth.Service.Admin.Domain.Subjects.Aggregates.Team", b =>
{
b.OwnsOne("Masa.Auth.Service.Admin.Domain.Subjects.Aggregates.AvatarValue", "Avatar", b1 =>
b.OwnsOne("Masa.Auth.Service.Admin.Domain.Subjects.Aggregates.Team.Avatar#Masa.Auth.Service.Admin.Domain.Subjects.Aggregates.AvatarValue", "Avatar", b1 =>
{
b1.Property<Guid>("TeamId")
.HasColumnType("uniqueidentifier");
Expand Down Expand Up @@ -2615,7 +2615,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

modelBuilder.Entity("Masa.Auth.Service.Admin.Domain.Subjects.Aggregates.User", b =>
{
b.OwnsOne("Masa.Auth.Service.Admin.Domain.Subjects.Aggregates.AddressValue", "Address", b1 =>
b.OwnsOne("Masa.Auth.Service.Admin.Domain.Subjects.Aggregates.User.Address#Masa.Auth.Service.Admin.Domain.Subjects.Aggregates.AddressValue", "Address", b1 =>
{
b1.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
Expand Down
98 changes: 0 additions & 98 deletions src/Services/Masa.Auth.Service.Admin/Services/PssoService.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="AspNet.Security.OAuth.Apple" Version="6.0.15" />
<PackageReference Include="AspNet.Security.OAuth.GitHub" Version="6.0.10" />
<PackageReference Include="AspNet.Security.OAuth.Weixin" Version="6.0.11" />
<PackageReference Include="Masa.BuildingBlocks.Authentication.OpenIdConnect.Models" Version="1.0.1-preview.10.3" />
<PackageReference Include="Masa.BuildingBlocks.Authentication.OpenIdConnect.Models" Version="1.0.1-preview.10.4" />
<PackageReference Include="Masa.BuildingBlocks.StackSdks.Auth.Contracts" Version="1.0.1-preview.10.3" />
<PackageReference Include="Masa.Contrib.Exceptions" Version="$(MasaFrameworkPackageVersion)" />
<PackageReference Include="Masa.Contrib.Caching.Distributed.StackExchangeRedis" Version="$(MasaFrameworkPackageVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public ImpersonationGrantValidator(IAuthClient authClient)
public async Task ValidateAsync(ExtensionGrantValidationContext context)
{
var impersonationToken = context.Request.Raw["impersonationToken"];
var scheme = context.Request.Raw["scheme"] ?? string.Empty;
var environment = context.Request.Raw["environment"] ?? string.Empty;
if (string.IsNullOrEmpty(impersonationToken))
{
Expand Down Expand Up @@ -55,17 +56,20 @@ public async Task ValidateAsync(ExtensionGrantValidationContext context)
claims.Add(new Claim(IMPERSONATOR_USER_ID, cacheItem.ImpersonatorUserId.ToString()));
}

var authUser = await _authClient.UserService.GetThirdPartyUserByUserIdAsync(new GetThirdPartyUserByUserIdModel
if (!string.IsNullOrEmpty(scheme))
{
Scheme = "Psso",
UserId = cacheItem.TargetUserId
});
var authUser = await _authClient.UserService.GetThirdPartyUserByUserIdAsync(new GetThirdPartyUserByUserIdModel
{
Scheme = scheme,
UserId = cacheItem.TargetUserId
});

if (authUser != null)
{
foreach (var item in authUser.ClaimData)
if (authUser != null)
{
claims.Add(new Claim(item.Key, item.Value));
foreach (var item in authUser.ClaimData)
{
claims.Add(new Claim(item.Key, item.Value));
}
}
}

Expand Down
Loading

0 comments on commit 4b5d41d

Please sign in to comment.