getcredential

getcredential takes a Credential Name and returns the matching Credential Object.


Usage:


getcredential(FQN)        


Where:


FQN: Is the qualified name of the credential to be retrieved.


Returns:


Credential Object


A qualified name can include as many Domain names as is necessary to uniquely identify the credential. If the credential name is unique within the Domains to which the invoking user has access, then no qualification is necessary. Only if there is more than one credential with the same name (in different accessible domains) will it be necessary to qualify the credential name with the domain in which it is located.


Examples:


1) Retrieve a Credential.


set db2creds = getcredential("DB2LoginCredentials");

set username = ${db2creds.username};

set password = ${db2creds.password};

// username and password can now be used to access external system


2) Retrieve a Credential specifying the enclosing domain:


set db2creds = getcredential("Project1.DB2LoginCredentials");

set username = ${db2creds.username};

set password = ${db2creds.password};

// username and password can now be used to access external system


See Also:

getApplication(), getComponent(), getEnvironment(), getserver(), getuser(), getusergroup()