UserClient offers a method to change PIN for currently logged in user profile. This methods is called
changePin and requires one argument:
OneginiChangePinHandlerthe changed PIN handler to return the result of change PIN action.
The SDK will handle flow of changing the PIN using
OneginiCreatePinRequestHandler handlers. Please read
PIN authenticator topic guide to learn how to implement those two handlers and how to cancel PIN change process.
void onSuccess()is called when PIN was changed.
void onError(final OneginiChangePinError oneginiChangePinError)is called when some error during changing PIN occurred.
Example code for changing PIN¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
For more info on error handling see the error handling topic guide.
As you can see in the example above we handle only one error case - when user got deregistered (probably due to too many failure PIN attempts). Please note
that you can handle errors that are relevant to you differently. To accomplish that you should compare the
OneginiChangePinError#getErrorType() value with
OneginiChangePinError error type definitions. The
OneginiChangePinError will also contain an additional error description for debugging and possibly a
Throwable object which you can get with the