C# Class Microsoft.WindowsAzure.Commands.ScenarioTest.Common.TokenCloudCredentialsHelper

Helper for TokenCloudCredentials
Afficher le fichier Open project: Azure/azure-powershell Class Usage Examples

Méthodes publiques

Méthode Description
CopyResourceToFile ( string resourceName, string fileName ) : void

Copy binary resource to a file

GetToken ( string authEndpoint, string tenant, string clientId ) : AuthenticationResult

Returns token (requires user input)

GetTokenFromBasicCredentials ( string user, string password, string authority = "https://login.windows-ppe.net", string tenant = "common" ) : string

Get an AAD token using user and password credentials against a login authority

Private Methods

Méthode Description
CleanConsoleOutputString ( string inString ) : string

Remove unprintable characters from a console output string

CreateFilenameFromUri ( Uri uri ) : string
EnsureNoTrailingSlash ( string authority ) : string

Remove trailing slashes from a string

EnsureTokenCreationEnvironment ( ) : void

Ensure that all tools required for token authentication are installed on the server

ExtractZipFile ( string zipFilePath, string outputDir ) : void

Extract the zip file to the current directory

GetAADToken ( string user, string password, string authority, string tenant ) : string

Get an aad token given a username, password, and authority

GetNodePath ( ) : string

Get the path of the node executable on this system

GetProcessResult ( string path, string arguments, Func IsSuccess ) : string

Run the given command and arguments and return the result returned in standard output

GetProcessStreamValue ( StreamReader streamReader ) : string

Convert a stream reader to a string

IsPrintableChar ( char current ) : bool

Determine if the character is printable

TokenCreationEnvironmentInitialized ( ) : bool

Determines if the token creation script exists in the directory

Method Details

CopyResourceToFile() public static méthode

Copy binary resource to a file
public static CopyResourceToFile ( string resourceName, string fileName ) : void
resourceName string The fully qualified name of the resource
fileName string
Résultat void

GetToken() public static méthode

Returns token (requires user input)
public static GetToken ( string authEndpoint, string tenant, string clientId ) : AuthenticationResult
authEndpoint string
tenant string
clientId string
Résultat Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult

GetTokenFromBasicCredentials() public static méthode

Get an AAD token using user and password credentials against a login authority
public static GetTokenFromBasicCredentials ( string user, string password, string authority = "https://login.windows-ppe.net", string tenant = "common" ) : string
user string The username credential.
password string The password credential.
authority string The login authority.
tenant string
Résultat string