none
Calling Creds from Windows Credential Manager RRS feed

  • Question

  • I am attempting to make WCM a repository for hundreds of API Keys by storing those keys into the password field. To my knowledge this is a one way encryption. I managed to find a way to call the object by it's internet or network address property. 

    However, I am unable to use this keys to authenticate into remote servers because they are stored as securestrings. And, if I convert them, they are encrypted strings. Is there a more practical way to go about this?  I intend to build PowerShell scripts that would call these API keys for querying data against multiple different api endpoints.

    Saturday, January 28, 2017 5:41 PM

Answers

  • You have to enable visibility of the password.

    function Get-PWVResources{
    	Param(
    		[switch]$AsPlainText
    	)
    	[void][Windows.Security.Credentials.PasswordVault, Windows.Security.Credentials, ContentType = WindowsRuntime]
    	$pv = New-Object Windows.Security.Credentials.PasswordVault
    	$pv.RetrieveAll()|
    		ForEach-Object{
    			if($AsPlainText){ 
    				$_.RetrievePassword()
            	}
    			$_
        	}
    }
    


    \_(ツ)_/

    Saturday, January 28, 2017 6:29 PM

All replies

  • You have to enable visibility of the password.

    function Get-PWVResources{
    	Param(
    		[switch]$AsPlainText
    	)
    	[void][Windows.Security.Credentials.PasswordVault, Windows.Security.Credentials, ContentType = WindowsRuntime]
    	$pv = New-Object Windows.Security.Credentials.PasswordVault
    	$pv.RetrieveAll()|
    		ForEach-Object{
    			if($AsPlainText){ 
    				$_.RetrievePassword()
            	}
    			$_
        	}
    }
    


    \_(ツ)_/

    Saturday, January 28, 2017 6:29 PM
  • There are many decent credential mangers available in the PSGallery:

    find-module *credential*,*vault*


    \_(ツ)_/

    Saturday, January 28, 2017 6:36 PM