This tutorial illustrates the native Android client-side authentication components for form-based authentication. Make sure you read Form-based authentication first.
Creating the client-side authentication components
Create a native iOS application and add the MobileFirst native APIs following the documentation.
In your storyboard, add a ViewController containing a login form.
Create a MyChallengeHandler class as a subclass of ChallengeHandler
We will implement some of the ChallengeHandler methods to respond to the form-based challenge.
The isCustomResponse method of the challenge handler is invoked each time that a response is received from the server. It is used to detect whether the response contains data that is related to this challenge handler. It must return either true or false.
The default login form that is returned from the MobileFirst server contains the j_security_check string. If the challenge handler detects it in the response, return true.
If isCustomResponse returns true, the framework calls the handleChallenge method. This function is used to perform required actions, such as hide application screen and show login screen.
onSuccess and >onFailure get triggered when the authentication ends.
You need to call submitSuccess to inform the framework that the authentication process is over, and allow the invocation’s success handler to be called.
In your LoginViewController, when the user clicks to submit his credentials, you need to call submitLoginForm to send the credentials to the MobileFirst Server.