Skip to main content

SILK UI Framework

 

OutSystems

Pin Code Component

The Pin Code component allows to easily register a pin code, and validate a login, or another action that requires a pin code in your mobile app. It's the perfect way to secure your information.
Upon validation, you can unlock the app or a specific workflow.

How to Use the Pin Code Component

The PinCode component has two blocks, Pincode_Register and Pincode_Unlock. To register a new Pin Code, drag the Pincode_Register block to your screen, configure the parameters and events and set an entry point according to your business logic. You can then assign a pin code to the currently logged in user.

To unlock the app, screen or flow using the registered PIN code, drag the Pincode_Unlock block to the screen, configure the parameters and events and set the entry point according to your business logic. Use the HasPin action to check if the user has a Pin registered.

1. In your Application Module, click the Manage Dependencies button.

2. Select the component and all its actions, blocks and entities.

Registering a new Pin or Unlocking an Action, Screen or Flow

1. Add references to the Pin Code component.

2. Drag either the Pincode_Register or the Pincode_Unlock block, depending on the action you're configuring, to your screen and set the PinLength of your pin code.

a. If an invalid length is set, the PinLength will default to 4.
b. If set to 0, the user can set the pin with as many characters as desired. This enables an OK button to confirm the pin.

 

3. Create a new handler for the PinRegistrationError or the PinUnlockError event, depending on the block selected in step 2. This event provides an ErrorMessage, you can choose to use this message or create your own message.

 

4. Create a new handler for the PinRegistrationSuccess or the PinUnlockSuccess event, depending on the block selected in step 2. This event will be triggered whenever the user provides a matching PIN. Normally, this handler is used to change the destination.

Validating if a User has a Pin Code Registered

1. Add references to the Pin Code component, and create the Register/Unlock scenario, as described in the previous section.

2. Create a new client action and name it CheckPIN. This action can be used whenever you need to check the user identity.

3. Use the HasPin client action provided by Pin Code component to check if the user has a registered PIN.

 

Pincode_Register Parameters and Events

TitlePlaceholder (Placeholder) Enter a title for the page.
RegistrationText (Placeholder) Text displayed for the pin code registration process.
ConfirmationText (Placeholder) Text displayed for the pin code confirmation process.
ContentPlaceholder (Placeholder) Use this placeholder to add content such as links to recover a password, the option to log in with another user, etc.
PinLength (Integer) Determine the length of the pin code.
If an invalid length (negative value) is set, the pin length will default to 4.
If set to 0, the user can set the PIN with as many characters as desired. This enables an OK button to confirm the pin.
PinRegistrationError (Event) Event triggered when an error occurs.
ErrorMessage (Text) Message to display when the registered pin code and the confirmation pin code don't match. Block will reset to the step where you set the pin code.
PinRegistrationSuccess (Event) Event triggered on successful pin code registration.

 

Pincode_Unlock Parameters and Events

TitlePlaceholder (Placeholder) Enter a title for the page.
Option (Placeholder) Place a button or a link to use for another action.
ContentPlaceholder (Placeholder) Use this placeholder to add content such as links to recover a password, the option to log in with another user, etc.
PinLength (Integer) Determine the length of the pin code.
If an invalid length (negative value) is set, the pin length will default to 4.
If set to 0, the user can set the PIN with as many chars as desired. This enables an OK button to confirm the pin.
PinUnlockError (Event) Event triggered when an error occurs.
ErrorMessage (Text) Message to display when the registered pin code and the confirmation pin code don't match. Block will reset to the first step.
PinUnlockSuccess (Event) Event triggered when the pin code matches the previously registered pin code.

 

Client Actions

HasPin Returns True if the provided user has a Pin registered.
This action will return false if no logged user is provided.
ResetPin Reset the PIN code of the logged user. If the Keystore plugin is available, its value is removed; otherwise the entry in LocalUser entity is set as empty.
  ErrorMessage (Text) Returns the caught exception message, when an error occurs.
ErrorMessage is empty by default, meaning a successful reset.

 

  • Was this article helpful?