Get-XDAuthenticationEx
Internally executed cmdlet to configure the SDK to communicate with either an on-premises or cloud-hosted controller, with the required address and authentication settings.
Syntax
Get-XDAuthenticationEx
[-CustomerId <String>]
[-BearerToken <String>]
[-ProfileName <String>]
[-ServiceProfileName <String>]
[-EnvironmentName <String>]
[-Staging]
[<CommonParameters>]
Description
NOTE: This cmdlet is not intended to be used directly. Instead use Get-XdAuthentication, which supports temporary credential profiles and automatic bearer token refreshing.
Configures user authentication settings for the SDK cmdlets in the active session. The SDK can be configured to work in on-premises mode, where the AdminAddress specified for any cmdlet is honored, and one of three Cloud authentication modes, where the AdminAddress is automatically overridden, and the required XD authentication is obtained and added to each message.
The three Cloud authentication modes are:
-
CloudMC: Prompt for MyCitrix credentials for each PowerShell session.
-
CloudApi: Use the customer ID and Citrix Cloud API Key stored in the user's Windows profile.
-
CloudToken: Use the specified customer ID and current Citrix Cloud Bearer Token.
These modes each use a Bearer Token to generate a Citrix Cloud auth header (stored in the session variable \$XDAuthToken), which is added to each subsequent cmdlet call to the cloud-hosted controller.
The Customer ID is used to generate the AdminAddress, which is stored in the session variable \$XDSDKProxy, and will override any AdminAddress parameter passed to subsequent cmdlets.
Specifying -BearerToken will put the SDK into CloudToken mode, ignoring a default authorization profile.
Specifying -ProfileName will attempt to load the named authentication profile from the users' profile store, and set the authentication mode based on the profile's settings.
If neither -BearerToken, nor -ProfileName are specified, a profile named 'default' will be loaded and used if found.
If none of previous methods result in a usable Citrix Cloud Bearer Token, or the SDK is explicitly configured for CloudMC mode, the user will be presented with a GUI logon dialog to authenticate using MyCitrix credentials. If the logon is associated with multiple Citrix Cloud customers, the user will have option to select which one to administer, unless it has been pre-selected by passing the CustomerId parameter.
Examples
EXAMPLE 1
Authenticate using the default XD authentication method for the current session.
Get-XDAuthenticationEx
EXAMPLE 2
Authenticate with Citrix Cloud using the specified Bearer Token.
Get-XDAuthenticationEx -BearerToken JesDFasldfasdfjas;jfhlkagkgf...
EXAMPLE 3
Authenticate with Citrix Cloud using the API Key stored in the specified profile.
Get-XDAuthenticationEx -ProfileName TestApiKey
Parameters
-CustomerId
Citrix Cloud Customer name.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-BearerToken
A Citrix Cloud-generated Bearer Token for the specified customer.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-ProfileName
The name associated with a set of credentials in the local store that are to be read.
| Type: | String |
| Accepted values: | CitrixCloudCommercial, CitrixCloudCommercialStaging, CitrixCloudJapan, CitrixCloudJapanStaging, CitrixCloudUSGovernment, CitrixCloudUSGovernmentStaging, WindowsCurrentUser |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-ServiceProfileName
Service Profile Name used for Service Key Authentication - Internal use only
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
-EnvironmentName
Commercial, Japan or USGovernment
| Type: | String |
| Accepted values: | Commercial, Japan, USGovernment |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-Staging
Internal use only
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
None
You cannot pipe input into this cmdlet.
Outputs
None
By default, this cmdlet returns no output.