本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
在 WorkSpaces 個人中自訂品牌
Amazon WorkSpaces 可讓您使用 API 使用自己的品牌標誌、IT 支援資訊、忘記密碼連結和登入訊息自訂登入頁面的外觀,為使用者建立熟悉的 WorkSpaces 體驗。 WorkSpace您的品牌會在使用者的 WorkSpace 登入頁面中顯示,而非預設 WorkSpaces 品牌。
支援的用戶端如下:
Windows
Linux
Android
MacOS
iOS
Web Access
注意
若要使用中的 ClientBranding API 修改品牌元素 AWS GovCloud (US) Region,請使用 5.10.0 的用 WorkSpaces 戶端版本。
匯入自訂品牌
若要匯入您的用戶端品牌自訂,請使用動作 ImportClientBranding
,其中包含下列元素。如需詳細資訊,請參閱 ImportClientBranding API 參考。
重要
用戶端品牌屬性為公眾面向。確保您不包含敏感資訊。

-
支援連結
-
標誌
-
忘記密碼連結
-
登入訊息
品牌元素 | 描述 | 要求和建議 |
---|---|---|
支援連結 | 可讓您指定支援電子郵件連結,供使用者聯絡以尋求協助 WorkSpaces。您可以使用 SupportEmail 屬性,或使用 SupportLink 屬性提供支援頁面的連結。 |
|
標誌 | 可讓您使用 Logo 屬性來自訂貴組織的標誌。 |
|
忘記密碼連結 | 可讓您使用 ForgotPasswordLink 屬性來新增網址,如果使用者忘記密碼,就可以前往該屬性 WorkSpace。 | 長度限制:長度下限為 1。長度上限為 200。 |
登入訊息 | 可讓您使用登入畫面上的 LoginMessage 屬性來自訂訊息。 |
|
以下是使用的範例程式碼片段 ImportClientBranding。
AWS 第二版
警告
匯入自訂商標會覆寫該平台內您使用自訂資料指定的屬性。也會覆寫您未使用預設自訂品牌屬性值指定的屬性。您必須包含您不想覆寫之任何屬性的資料。
aws workspaces import-client-branding \ --cli-input-json file://~/Downloads/import-input.json \ --region us-west-2
匯入 JSON 檔案看起來應該如下列範例程式碼所示:
{ "ResourceId": "<directory-id>", "DeviceTypeOsx": { "Logo": "iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAC0lEQVR42mNgQAcAABIAAeRVjecAAAAASUVORK5CYII=", "ForgotPasswordLink": "https://amazon.com/", "SupportLink": "https://amazon.com/", "LoginMessage": { "en_US": "Hello!!" } } }
下列範例 Java 程式碼片段會將標誌影像轉換為 base64 編碼字串:
// Read image as BufferImage BufferedImage bi = ImageIO.read(new File("~/Downloads/logo.png")); // convert BufferedImage to byte[] ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageIO.write(bi, "png", baos); byte[] bytes = baos.toByteArray(); //convert byte[] to base64 format and print it String bytesBase64 = Base64.encodeBase64String(bytes); System.out.println(bytesBase64);
下列範例 Python 程式碼片段會將標誌影像轉換為 base64 編碼的字串:
# Read logo into base64-encoded string with open("~/Downloads/logo.png", "rb") as image_file: f = image_file.read() base64_string = base64.b64encode(f) print(base64_string)
Java
警告
匯入自訂商標會覆寫該平台內您使用自訂資料指定的屬性。也會覆寫您未使用預設自訂品牌屬性值指定的屬性。您必須包含您不想覆寫之任何屬性的資料。
// Create WS Client WorkSpacesClient client = WorkSpacesClient.builder().build(); // Read image as BufferImage BufferedImage bi = ImageIO.read(new File("~/Downloads/logo.png")); // convert BufferedImage to byte[] ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageIO.write(bi, "png", baos); byte[] bytes = baos.toByteArray(); // Create import attributes for the plateform DefaultImportClientBrandingAttributes attributes = DefaultImportClientBrandingAttributes.builder() .logo(SdkBytes.fromByteArray(bytes)) .forgotPasswordLink("https://aws.amazon.com/") .supportLink("https://aws.amazon.com/") .build(); // Create import request ImportClientBrandingRequest request = ImportClientBrandingRequest.builder() .resourceId("<directory-id>") .deviceTypeOsx(attributes) .build(); // Call ImportClientBranding API ImportClientBrandingResponse response = client.importClientBranding(request);
Python
警告
匯入自訂商標會覆寫該平台內您使用自訂資料指定的屬性。也會覆寫您未使用預設自訂品牌屬性值指定的屬性。您必須包含您不想覆寫之任何屬性的資料。
import boto3 # Read logo into bytearray with open("~/Downloads/logo.png", "rb") as image_file: f = image_file.read() bytes = bytearray(f) # Create WorkSpaces client client = boto3.client('workspaces') # Call import API response = client.import_client_branding( ResourceId='<directory-id>', DeviceTypeOsx={ 'Logo': bytes, 'SupportLink': 'https://aws.amazon.com/', 'ForgotPasswordLink': 'https://aws.amazon.com/', 'LoginMessage': { 'en_US': 'Hello!!' } } )
PowerShell
#Requires -Modules @{ ModuleName="AWS.Tools.WorkSpaces"; ModuleVersion="4.1.56"} # Specify Image Path $imagePath = "~/Downloads/logo.png" # Create Byte Array from image file $imageByte = ([System.IO.File]::ReadAllBytes($imagePath)) # Call import API Import-WKSClientBranding -ResourceId <directory-id> ` -DeviceTypeLinux_LoginMessage @{en_US="Hello!!"} ` -DeviceTypeLinux_Logo $imageByte ` -DeviceTypeLinux_ForgotPasswordLink "https://aws.amazon.com/" ` -DeviceTypeLinux_SupportLink "https://aws.amazon.com/"
若要預覽登入頁面,請啟動 WorkSpaces 應用程式或網頁登入頁面。
注意
變更可能需要多達 1 分鐘的時間才會出現。
描述自訂品牌
若要查看您目前擁有之用戶端品牌自訂的詳細資料,請使用動作 DescribeCustomBranding
。以下是使用的範例指令碼 DescribeClientBranding。如需詳細資訊,請參閱 DescribeClientBranding API 參考。
aws workspaces describe-client-branding \ --resource-id <directory-id> \ --region us-west-2
刪除自訂品牌
若要刪除您的用戶端品牌自訂,請使用動作 DeleteCustomBranding
。以下是使用的範例指令碼 DeleteClientBranding。如需詳細資訊,請參閱 DeleteClientBranding API 參考。
aws workspaces delete-client-branding \ --resource-id <directory-id> \ --platforms DeviceTypeAndroid DeviceTypeIos \ --region us-west-2
注意
變更可能需要多達 1 分鐘的時間才會出現。