Esempio n. 1
0
        public void Clear()
        {
            _logger.LogInformation("Clearing cache");
            FileIOWithRetries.DeleteCacheFile(_cacheFilePath, _logger);

            _logger.LogInformation($"Before deleting secret from Linux keyring");

            IntPtr error = IntPtr.Zero;

            Libsecret.secret_password_clear_sync(
                schema: GetLibsecretSchema(),
                cancellable: IntPtr.Zero,
                error: out error,
                attribute1Type: _attributeKey1,
                attribute1Value: _attributeValue1,
                attribute2Type: _attributeKey2,
                attribute2Value: _attributeValue2,
                end: IntPtr.Zero);

            if (error != IntPtr.Zero)
            {
                try
                {
                    GError err = (GError)Marshal.PtrToStructure(error, typeof(GError));
                    _logger.LogError($"An error was encountered while clearing secret from keyring in the {nameof(MsalCacheStorage)} domain:'{err.Domain}' code:'{err.Code}' message:'{err.Message}'");
                }
                catch (Exception e)
                {
                    _logger.LogError($"An exception was encountered while processing libsecret error information during clearing secret in the {nameof(MsalCacheStorage)} ex:'{e}'");
                }
            }

            _logger.LogInformation("After deleting secret from linux keyring");
        }
Esempio n. 2
0
        public void Clear()
        {
            _logger.LogInformation("Clearing cache");
            FileIOWithRetries.DeleteCacheFile(_cacheFilePath, _logger);

            _logger.LogInformation("Before delete mac keychain");
            MacKeyChain.DeleteKey(_keyChainServiceName, _keyChainAccountName);
            _logger.LogInformation("After delete mac keychain");
        }
Esempio n. 3
0
        public void Clear()
        {
            _logger.LogInformation("Clearing cache");
            FileIOWithRetries.DeleteCacheFile(_cacheFilePath, _logger);

            _logger.LogInformation($"Before delete mac keychain service: {_service} account {_account}");
            _keyChain.Remove(_service, _account);
            _logger.LogInformation($"After delete mac keychain service: {_service} account {_account}");
        }
 public void Clear()
 {
     _logger.LogInformation("Deleting cache file");
     FileIOWithRetries.DeleteCacheFile(_cacheFilePath, _logger);
 }