Convert SecureString to String - Get Secured Credential

@andraciorici, @Lavinia, @Horia
By exposing this method of retrieving secure password from Windows Credentials Vault we are ultimately compromising the security; as any developer can write this piece of code ant Production system and get the passwords from vault.
How can we avoid this security breach :

  1. Do we need to import any special Packages/API in order to make this code working? And is there any way we can disable such APIs so code won’t work?
  2. What can be other possible solutions to avoid such issues?