Configurer et utiliser l'information d'identification Autoriser l'annotation de mot de passe

Utilisez le fichier de package SDK CredentialTypeDemo.java fourni et configurez l'annotation CredentialAllowPassword pour le champ de mot de passe dans les actions de Automation 360 consigne.

Exemple : Consulter le fichier CredentialTypeDemo.java

Utilisez le fichier CredentialTypeDemo.java suivant situé à l'adresse : <dernier package-sdk>2.0.9\src\main\java\com\automationanywhere\botcommand\samples\commands\basic\types comme exemple de configuration de l'attribut d'informations d'identification.

@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);
Exemple : Configurer les attributs d'informations d'identification @Execute

Configurez les attributs index, type, label, description (facultatif) et credentialAllowPasswordAttribute. Lors de la création ou mise à jour d'un package existant, utilisez l'annotation CredentialAllowPassword pour permettre au sélecteur d'informations d'identification de choisir un attribut d'informations d'identification marqué comme champ de mot de passe.

@Execute
	public void printCredentials(@Idx(index = "2", type = AttributeType.CREDENTIAL)
	@Pkg(label = "[[CredentialTypeDemo.credentialsAllowPasswordAttribute.label]]")
	@CredentialAllowPassword SecureString credentialAllowPasswordAttribute) {
Configurer les attributs dans la Control Room

Dans le champ Nom de l'attribut, saisissez le password et une description facultative. Dans le champ Entrée, sélectionnez Standard, puis saisissez la Value. Dans le champ Sécurité, sélectionnez Utilisez l'attribut UNIQUEMENT sur les champs Mot de passe ou Masqué.

Utiliser l'attribut d'informations d'identification dans la Control Room
  • Dans le champ Sélectionner une information d'identification, sélectionnez informations d'identification. Dans le champ Attribut, sélectionnez nom d'utilisateur. Dans le champ Fournir les informations d'identification pour l'utilisateur (facultatif), sélectionnez Informations d'identification, puis Sélectionner.
  • Dans le champ Attribut, sélectionnez mot de passe. Dans le champ Fournir les informations d'identification pour le mot de passe (facultatif), sélectionnez Informations d'identification, puis Sélectionner.