Skip to main content

Posts

Showing posts with the label Authentication

Azure + GoLang SDK : Authenticating Part-2

The auth package lives at "github.com/Azure/go-autorest/autorest/azure/auth" In the above package, at the moment I have explored below two functions (my notes): NewAuthorizerFromFile method NewAuthorizerFromEnvironment method (this post)  This function definition looks like below :

Azure + GoLang SDK : Authenticating Part-1

My personal notes on how to authenticate to Azure in the GoLang code.  The auth package lives at "github.com/Azure/go-autorest/autorest/azure/auth" In the above package, at the moment I have explored below two functions: NewAuthorizerFromFile method NewAuthorizerFromEnvironment method

PowerShell + AzureRM : Automated login using Service Principal

Do you remember ? In the older Azure Service Management model, we had an option to import the publish settings file and use the certificate for authenticating. It saved a lot of hassle. That method is deprecating now but we have something better which we can use in the newer ARM model. BTW for record I find it really annoying to enter credentials each time when I want to quickly try something out on Azure. So I have been using two techniques for automated login to the AzureRM portal. Storing Service principal creds locally (encrypted at rest using Windows Data Protection API) and using that to login. Using Certificate based automated login .

PowerShell + REST API : Basic, CMS & CMSURL Authentication

While working with the REST API endpoints exposed by the leaders in MDM space (Hint - VMware acquired them) , I picked up few things on how to authenticate to the REST endpoints and would like to document those here. The post is generic about how to use the below Authentication schemes: Basic Authentication Certificate Based Authentication Basic Authentication In Basic authentication, we base 64 encode the UserName & Password and pass it in the header. Pretty straight forward on how to do it in PowerShell, S tore the Credentials and then just encode them : $Credential   =   Get-Credential $EncodedUsernamePassword   =   [System.Convert] :: ToBase64String( [System.Text.Encoding] :: UTF8 . GetBytes($( '{0}:{1}'   -f   $Credential . UserName ,   $Credential . GetNetworkCredential() . Password)))