public IInternetSharedRepositorySource GetSource(UserSecret userSecret, string sendReceiveServerUri, string registryServerUri) { if (userSecret == null || string.IsNullOrEmpty(sendReceiveServerUri) || string.IsNullOrEmpty(registryServerUri)) { throw new ArgumentException(); } string ptUsername = _jwtTokenHelper.GetParatextUsername(userSecret); var ptUser = new SFParatextUser(ptUsername); JwtRestClient jwtClient = GenerateParatextRegistryJwtClient(userSecret, registryServerUri); IInternetSharedRepositorySource source = new JwtInternetSharedRepositorySource(userSecret.ParatextTokens.AccessToken, jwtClient, ptUser, sendReceiveServerUri); source.RefreshToken(userSecret.ParatextTokens.AccessToken); return(source); }
public JwtInternetSharedRepositorySource(string accessToken, JwtRestClient registryClient, ParatextUser authenticationPtUser, string srServerUri) : base(authenticationPtUser, srServerUri) { _registryClient = registryClient; SetToken(accessToken); }