credential allow password 주석 구성 및 사용

제공된 CredentialTypeDemo.java 패키지 SDK 파일을 사용하고 Automation 360 로커 작업에 있는 비밀번호 필드의 CredentialAllowPassword 주석을 구성합니다.

예: CredentialTypeDemo.java 검토

아래 위치에 있는 다음 CredentialTypeDemo.java 파일을 사용합니다. <latest package-sdk>2.0.9\src\main\java\com\automationanywhere\botcommand\samples\commands\basic\types as an example on how to configure the credential attribute.

@BotCommand
@CommandPkg(label = "[[CredentialTypeDemo.label]]", 
description = "[[CredentialTypeDemo.description]]", icon = "sample.svg", name = "credentialTypeDemo")
public class CredentialTypeDemo {

	private static Logger logger = LogManager.getLogger(CredentialTypeDemo.class);

	/**
	 * To accept credentials the {@link AttributeType} in index should be
	 * {@link AttributeType.CREDENTIAL CREDENTIAL}. A {@link SecureString} is
	 * provided for any credentials type.
	 */
	@Execute
	public void printCredentials(@Idx(index = "1", type = AttributeType.CREDENTIAL)
	@Pkg(label = "[[CredentialTypeDemo.credentials.label]]")
	SecureString credentials) {
		// SecureString provides multiple way to access the data inside.
		// Let's try to get the user name and print it in logs.

		// To get the username as String
		String userName = credentials.getInsecureString();
		logger.trace("User name from getInsecureString : {}", userName);
예: 자격증명 속성 @Execute 구성

index, type, label, description(선택사항), credentialAllowPasswordAttribute를 구성합니다. 새 패키지를 생성하거나 기존 패키지를 업데이트할 때 CredentialAllowPassword 주석을 사용하여 자격증명 선택기가 비밀번호 필드로 표시된 자격증명 특성을 선택하도록 허용합니다.

@Execute
	public void printCredentials(@Idx(index = "2", type = AttributeType.CREDENTIAL)
	@Pkg(label = "[[CredentialTypeDemo.credentialsAllowPasswordAttribute.label]]")
	@CredentialAllowPassword SecureString credentialAllowPasswordAttribute) {
Control Room에서 속성 구성

속성 이름 필드에 password와 선택사항인 설명을 입력하고, 입력 필드에서 표준을 선택하고 Value를 입력합니다. 보안 필드에서 비밀번호 또는 마스킹된 필드에서만 특성 사용을 선택합니다.

에서 자격증명 속성 사용Control Room
  • 자격증명 선택 필드에서 자격증명을 선택합니다. 특성 필드에서 사용자 이름을 선택합니다. 사용자 자격증명 입력(선택사항) 필드에서 자격증명을 선택한 다음 선택을 선택합니다.
  • 특성 필드에서 비밀번호를 선택합니다. 비밀번호 자격증명 입력(선택사항) 필드에서 자격증명을 선택한 다음 선택을 선택합니다.