File tree 2 files changed +9
-0
lines changed
VirtoCommerce.Platform.Security/Extensions
VirtoCommerce.Platform.Web/Controllers/Api
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 2
2
using System . Collections . Generic ;
3
3
using System . Security . Claims ;
4
4
using OpenIddict . Abstractions ;
5
+ using VirtoCommerce . Platform . Core ;
5
6
6
7
namespace VirtoCommerce . Platform . Security . Extensions
7
8
{
@@ -42,5 +43,11 @@ public static ClaimsPrincipal SetClaimWithDestinations(this ClaimsPrincipal clai
42
43
43
44
return claimsPrincipal ;
44
45
}
46
+
47
+ public static bool IsImpersonated ( this ClaimsPrincipal claimsPrincipal )
48
+ {
49
+ return claimsPrincipal ? . HasClaim ( PlatformConstants . Security . Claims . OperatorUserId ) == true &&
50
+ claimsPrincipal ? . HasClaim ( PlatformConstants . Security . Claims . OperatorUserName ) == true ;
51
+ }
45
52
}
46
53
}
Original file line number Diff line number Diff line change @@ -335,6 +335,8 @@ public async Task<ActionResult> Exchange()
335
335
}
336
336
}
337
337
338
+ await HandleTokenRequest ( impersonatedUser , context ) ;
339
+
338
340
// Create a new authentication ticket, but reuse the properties stored in the
339
341
// authorization code/refresh token, including the scopes originally granted.
340
342
var ticket = await CreateTicketAsync ( impersonatedUser , context ) ;
You can’t perform that action at this time.
0 commit comments