Citrix Daas SDK

Get-XDAuthentication

Configures the SDK to communicate with either an on-premises or cloud-hosted controller, with the required address and authentication settings.

Syntax

Get-XDAuthentication
   [-CustomerId <String>]
   [-BearerToken <String>]
   [-ProfileName <String>]
   [-ServiceProfileName <String>]
   [-EnvironmentName <String>]
   [-Staging]
   [-ProxyUsername <String>]
   [-ProxyPassword <SecureString>]
   [-ProxyUseDefault]
   [<CommonParameters>]
<!--NeedCopy-->

Description

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 Bearer Token is automatically refreshed within the current session for up to 12 hours.

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 the session variable ‘$XDStoredCredentials’ has been previously set by Set-XDCredentials, those will be used before checking the profile store for a default profile.

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-XDAuthentication
<!--NeedCopy-->

EXAMPLE 2

Authenticate with Citrix Cloud using the specified Bearer Token.

Get-XDAuthentication -BearerToken JesDFasldfasdfjas;jfhlkagkgf...
<!--NeedCopy-->

EXAMPLE 3

Authenticate with Citrix Cloud using the API Key stored in the specified profile.

Get-XDAuthentication -ProfileName TestApiKey
<!--NeedCopy-->

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. A valid Bearer Token supplied to this command will be automatically refreshed in the current session for the next 12 hours.

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
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

-ProxyUsername

Username to login to proxy

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: True

-ProxyPassword

Password to login to proxy

Type: SecureString
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-ProxyUseDefault

Use default proxy credentials to authenticate proxy

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.

Get-XDAuthentication