Disable credential manager for a single application

I have a C # application that uses rasapi32.dll to create remote access. When I create such a connection in Windows 7, the credentials are saved in the credential manager as an entry called *session .

This *session entry in the credential manager causes existing connections to other resources (network resources, database connections) to become invalid. Is there a way to tell Windows not to store credentials?

I already know the solution, but this disables the storage of credentials for the entire system: setting the registry value HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\DisableDomainCreds to 1 .

I would like to disable it only for my application.

+4
source share
1 answer

You can simply delete the saved credentials Use CredDelete () from Advapi32 http://msdn.microsoft.com/en-us/library/windows/desktop/aa374787 (v ​​= vs .85). ASPX Windows 8 introduces a new managed library for working with Windows storage http://msdn.microsoft.com/library/windows/apps/windows.security.credentials.passwordvault.aspx?cs-save-lang=1&cs-lang=csharp # code-snippet-1

0
source

Source: https://habr.com/ru/post/1490210/


All Articles