Change PIN
Changing PIN
The OneWelcome Flutter plugin exposes changePin to allow the currently logged in user to change their PIN. The user is first required to provide their current PIN, before being allowed to create the new PIN. The required flow and their events are described below.
ChangePin related Events
For more information on how to handle these events and what kind of information they have see Event handling.
event | Reference |
---|---|
OpenPinAuthenticationEvent | Authenticate using Pin Flow |
ClosePinAuthenticationEvent | Authenticate using Pin Flow |
NextAuthenticationAttemptEvent | Authenticate using Pin Flow |
OpenPinRegistrationEvent | Create Pin |
PinNotAllowedEvent | Create Pin |
ClosePinRegistrationEvent | Create Pin |
ChangePin Flow
The resulting flow to change your pin will contain the following steps, for more details on how respond to events see Event handling:
- User starts the change pin flow by calling
Onegini.instance.userClient.changePin()
- An
OpenPinAuthenticationEvent
event will be broadcasted -
A user needs then to authenticate using the Pin's authentication acceptAuthenticationRequest function
- if the given pin was invalid a
NextAuthenticationAttemptEvent
event will be broadcasted
- if the given pin was invalid a
-
If the pin was valid,
ClosePinAuthenticationEvent
andOpenPinRegistrationEvent
events will be broadcasted -
A user needs to register using a new pin through the Pin's registration acceptAuthenticationRequest function
- if the pin was invalid a
PinNotAllowedEvent
event will be broadcasted
- if the pin was invalid a
-
If the pin was valid a
ClosePinRegistrationEvent
will be broadcaster after which thechangePin
function will resolve
Example code to start the change PIN flow for the currently logged in user:
Note that the PIN entered by the user should not be stored on the device or elsewhere in any shape or form. The plugin takes care of this for you in a secure manner.