Credential

1 minute read

This class provides methods to process a Flow credential object.

External credentials support is available automatically. For the credential widget to have external credential switch, the credential formElement declaration (parameter declaration in pluginspec.yaml) must include '<supportsCredentialReference>true</supportsCredentialReference>'.

Credentials should be named 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 credential is a parameter named 'credential'. Credential cred = configValues.getCredential('credential') // Getting type of credential. It is default, private_key, etc, String credentialType = cred.getCredentialType() String userName = cred.getUserName() String password = cred.getSecretValue() String credentialName = cred.getCredentialName()

getCredentialType()

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

Parameters:

None

Returns

(String) Credential Type

Usage

String 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

String 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

String credName = cred.getCredentialName()