Exemple #1
0
            public void Dispose()
            {
                IntPtr schemaPtr = GetLibsecretSchema();

                try
                {
                    LinuxNativeMethods.secret_password_clear_sync(schemaPtr, IntPtr.Zero, "service", ExpectedServiceName, "account", _cloudName);
                }
                finally
                {
                    LinuxNativeMethods.secret_schema_unref(schemaPtr);
                }
            }
Exemple #2
0
            public static IDisposable Create(string cloudName, string refreshToken)
            {
                IntPtr schemaPtr = GetLibsecretSchema();

                try
                {
                    LinuxNativeMethods.secret_password_store_sync(schemaPtr, LinuxNativeMethods.SECRET_COLLECTION_SESSION, $"{ExpectedServiceName}/{cloudName}", refreshToken, IntPtr.Zero, "service", ExpectedServiceName, "account", cloudName);
                }
                finally
                {
                    LinuxNativeMethods.secret_schema_unref(schemaPtr);
                }

                return(new LinuxRefreshTokenFixture(cloudName));
            }