Credential

1 minute readReferenceExtensibilityDeveloper productivity

This class provides methods to process a Flow credential object.

External credential support:

PDK can process external credentials internally without any changes in plugin code. In the plugin configuration, external plugin credentials stored in a different project are available by choosing them in the new credential widget.

External credentials are different from runtime credentials in the way of how they are referenced. While the usual credential has a name like credential or proxy_credential, reference external credentials by its path. For example: /YourProject/your_credental.

Name credentials using one of the following patterns:

  • credential

    This, by default, is used as the first credential.

  • %name%_credential

    This is used as the second credential.

    For example, if your use case consists of proxy username and proxy password, name the parameter as proxy_credential.

FlowPDF supports both patterns above.

# retrieving parameter of current plugin configuration. # in this case credentals is a parameter named credential. my $cred = $cofigValues->getParameter('credential'); # getting type of credential. It is default, private_key, etc, my $credentialType = $cred->getCredentialType(); my $userName = $cred->getUserName(); my $password = $cred->getSecretValue(); my $credentialName = $cred->getCredentialName();

getCredentialType()

Returns different values for different credentials type. Currently only 'default' is supported.

Parameters:

None

Returns

(String) Credential Type

Usage

my $credType = $cred->getCredentialType();

getUserName()

Returns a user name that is being stored in the current credential.

Parameters

None

Returns

(String) Username for current credential object.

Usage

my $userName = $cred->getUserName();

getSecretValue()

Returns a secret value that is being stored in the current credential.

Parameters

None

Returns

(String) Secret value from the current credential object

getCredentialName()

Returns a name for the current credential.

Parameters

None

Returns

(String) A name from the current credential.

Usage

my $credName = $cred->getCredentialName();