6
6
using AuthServer . Server . Services ;
7
7
using AuthServer . Server . Services . Crypto ;
8
8
using AuthServer . Server . Services . ReverseProxy . Configuration ;
9
+ using AuthServer . Server . Services . SCIM ;
9
10
using AuthServer . Server . Services . TLS ;
10
11
using AuthServer . Shared . Admin ;
11
12
using Google . Protobuf . WellKnownTypes ;
@@ -25,20 +26,23 @@ public class AppsService : AuthServer.Shared.Admin.AdminApps.AdminAppsBase
25
26
private readonly SecureRandom _secureRandom ;
26
27
private readonly ConfigurationProvider _configurationProvider ;
27
28
private readonly MemoryPopulator _memoryPopulator ;
29
+ private readonly ISyncHandler _syncHandler ;
28
30
29
31
public AppsService (
30
32
AuthDbContext authDbContext ,
31
33
IDataProtectionProvider dataProtectionProvider ,
32
34
SecureRandom secureRandom ,
33
35
ConfigurationProvider configurationProvider ,
34
- MemoryPopulator memoryPopulator
36
+ MemoryPopulator memoryPopulator ,
37
+ ISyncHandler syncHandler
35
38
)
36
39
{
37
40
_authDbContext = authDbContext ;
38
41
_ldapSettingsDataProtector = dataProtectionProvider . CreateProtector ( "LdapSettingsDataProtector" ) ;
39
42
_secureRandom = secureRandom ;
40
43
_configurationProvider = configurationProvider ;
41
44
_memoryPopulator = memoryPopulator ;
45
+ _syncHandler = syncHandler ;
42
46
}
43
47
44
48
public override async Task < AddGroupToAppReply > AddGroupToApp ( AddGroupToAppRequest request , ServerCallContext context )
@@ -330,5 +334,15 @@ public override async Task<RemoveGroupFromAppReply> RemoveGroupFromApp(RemoveGro
330
334
331
335
return new RemoveGroupFromAppReply { Success = true } ;
332
336
}
337
+
338
+ public override async Task < Empty > TriggerScimSync ( ScimSyncRequest request , ServerCallContext context )
339
+ {
340
+ SCIMAppSettings setting = await _authDbContext
341
+ . SCIMAppSettings
342
+ . SingleAsync ( s => s . AuthAppId == new Guid ( request . AppId ) ) ;
343
+
344
+ await _syncHandler . FullSyncAsync ( setting . Id ) ;
345
+ return new Empty ( ) ;
346
+ }
333
347
}
334
348
}
0 commit comments