hub.eb?material_id=557&track_id=547

Checking Credentials


The Security Manager interface provides methods to retrieve credential values set in the Integration event. Methods include:

  • getCredential(credentialName) - returns the value of the named credential. If the credential does not exist or the user is not logged on, the function will return null
  • getCredentials() - returns all of the user credentials set by the Logon Service when the user logged on.
  • checkCredentialValue(credentialName, credentialValue) - returns true when the entered value matches the value set in the Logon event, false otherwise.

Steps


1

Complete the following steps using the Logon Service you created in the Introduction to Logon Services tutorial.

2

Add the following code to the Integration event script of your Logon Service.

tables.CREDENTIAL.insertRow();
tables.CREDENTIAL.ID.value = "email";
tables.CREDENTIAL.VALUE.value = "joe.bloggs@example.com";
tables.CREDENTIAL.updateTable();
3

Create a form and create a field called email. Add the field to the page.

4

Create a Before Page script and add the following code:

fields.email.value = system.securityManager.getCredential("email");
5

Run the form and notice how the email field has been populated with the value of the email credential.

Current Module

Related