Confident Technologies Mobile Authentication Service
Confident Mobile Authentication™
Image-Based, User Authentication for Mobile Applications and Devices
Sample API
Setup and using the iPhone/iPad library toolkit in your iOS project
This document describes an example use case of the Confident Technologies iOS Library and Web Service API to
use the Confident ImageShield technology for Mobile Authentication (MyBank). Please contact
[email protected] or (858) 345-5640 to get key credentials and the complete, up-to-date API
for our web service.
These libraries are being continuously updated and expanded. We are adding and modifying resources,
requests, representations, and documentation. Our goal is to help developers make their mobile applications
more secure using our image-based user authentication technology. For the most up-to-date libraries and
documentation, please contact [email protected].
Please email [email protected] to let us know how we can make your development work
easier.
Visit www.ConfidentTechnologies.com to view the APIs for our other
image-based authentication offerings: web authentication, multi-factor
authentication and CAPTCHA.
265 Santa Helena Drive, Suite 105 • Solana Beach, CA 92075 • (858) 345-5640 • www.ConfidentTechnologies.com 1
Getting Started
To add the Confident ImageShield component to your Xcode application, you need to obtain the toolkit from
Confident Technologies (contact [email protected]). The toolkit will consist of 5 files:
Add the files to your Xcode iPhone Project
Simply drag these files into your Xcode project. You will be prompted whether to copy or link to the files, select
the “Copy items into the destination...” option and click OK.
Confident ImageShield™ Usage Concept
Now that you have the files in your project, you will now have access to the Confident ImageShield objects via
the header files. Communication between the ImageShield objects and your application will be via the
ImageShieldDelegate delegate. Your application controls its own internal “User Accounts” which is not touched
in any way by Confident ImageShield.
Confident ImageShield provides a secondary dynamic security control mechanism by allowing the user to select
image categories (always shown in random order and varying images) that they remember during account
setup. Your iPhone application will perform its normal user authentication, once authentication is successful,
then you instantiate an ImageShield for the user (provided by an ImageShieldVC object) which you slide into
your ViewController object. Once it’s on display, the user selects their personal categories from among a list of
images. Once successful, you can remove the ImageShieldVC and continue with your application. If unsuccessful,
the user can be returned to the authentication view or wherever you want the application to navigate. Details
are explained in the following pages.
265 Santa Helena Drive, Suite 105 • Solana Beach, CA 92075 • (858) 345-5640 • www.ConfidentTechnologies.com 2
ImageShield Sample iPhone Application (mybank)
Also included with the toolkit will be a sample Xcode iPhone application that shows a sample application that
uses ImageShield and libraries. Please use that project for reference as you integrate the ImageShield toolkit
into your application. There are 2 files of particular interest that contain the main logic in using the toolkit, they
are: LoginChoiceView.h which implements the ImageShieldDelegate protocol and LoginChoiceView.m that
contains all of the communication to the ImageShield API via the delegate. You will want to implement the
ImageShieldDelegate protocol in at least one View of your application.
Create a New ImageShield for New Account Setup
The method that creates an ImageShield for a new account is shown below. It will instantiate a new
ConfidentTechnologies object. Here you will use your own customerID, siteID, apiUser, and apiPwd values given
to you from ConfidentTechnologies (contact [email protected] more information). The final
method called on the confTech object will request an ImageShield for new account setup. Then, the
ImageShieldDelegate protocol method “receiveImageShieldForNewAccount” will receive the ImageShieldVC
view controller object. Once we get this we present it as a modal view controller. The user then will interact with
the ImageShieldVC that is now on display. Notice that we release the ImageShieldVC object after presentation,
so later, when you remove it from display it will release its memory.
The user will eventually “Save” their selections which will be passed via the ImageShieldDelegate protocol
method “saveImageShieldCategories”. You will save this content along with the users internal account
credentials. The bundle object is an encrypted object that describes the user’s categories. This bundle object will
be used later when the user authenticates (explained in the following pages). This encrypted object will be sent
to the ImageShield service when requesting authentication. You will dispose of the confTech object at the end of
this method.
265 Santa Helena Drive, Suite 105 • Solana Beach, CA 92075 • (858) 345-5640 • www.ConfidentTechnologies.com 3
-(void)showImageShieldGrid {
NSString *user = ((UITextField *)[self viewWithTag:USER_TF]).text;
[[self viewWithTag:USER_TF] resignFirstResponder];
[[self viewWithTag:PWD_TF] resignFirstResponder];
// Get the ImageShield
confTech = [[ConfidentTechnologies alloc]
initCustomerID:@"a8xGbI7O"
siteID:@"icodeglobal"
apiUser:@"WLIybXjgc7Ebb65dAdIiQ6vUmMBIqndCzvmp8ABR"
apiPwd:@"bJIBLbb4XnnsVYD2H3Xuub1zhfcpFT5u7spM59C4"
delegate:self
currentView:self
];
//
// Set the Help Text
//
[confTech setHelpBannerText:@"ImageShield\xE2\x84\xA2"];
[confTech setHelpSubBannerText:@"What is ImageShield?"];
[confTech setHelpMainText:@"ImageShield is an additional form of
authentication. You select 3 or 4 images that each represent a type of category(ie. dogs, cats, planes, etc.). The categories
you select will be attached toyour authentication profile. Upon authentication you may be asked to recallyour selected
categories from a list of images. That's it!\n\nUse your fingerto scroll up and down through the list of images. Select 3 or 4
categories thatyou can easily remember, then touch \"Save\" to save those categories in yourprofile."];
[confTech setHelpFooterText:@"Powered by Confident Technologies"];
[confTech createImageShieldForNewAccount:user];
//
// Receive the ImageShield in method receiveImageShieldForNewAccount
//
}
//
// The delegate will receive an ImageShieldVC that the user can display for aNew Account setup
//
-(void)receiveImageShieldForNewAccount:(ImageShieldVC *)imageShield {
[myBankVC presentModalViewController:imageShield animated:YES];
[imageShield release];
}
//
// Called when the user saves their categories during new account setup
// Also release the confTech object
//
-(void)saveImageShieldCategories:(NSArray *)catArray bundle:(NSString *)bundle {
NSString *user = ((UITextField *)[self viewWithTag:USER_TF]).text; LocalENV *env = [LocalENV sharedInstance];
[env setUserImageShieldIDs:user shieldIDs:catArray bundle:bundle];
NSLog(@"Saved Image Shield Categories: %@\nBundle: %@",catArray,bundle);
// Dismiss the ImageShieldGrid
//
265 Santa Helena Drive, Suite 105 • Solana Beach, CA 92075 • (858) 345-5640 • www.ConfidentTechnologies.com 4
[myBankVC dismissModalViewControllerAnimated:YES];
//
// Show the user their Saved Account Info
//
[self showUserProfile];
[confTech release];
}
Create a New ImageShield for Authentication
In this phase, your iPhone application has already authenticated in its own private way. When successful, you
can call ImageShield to perform secondary authentication. The encrypted bundle that was created during
account setup and stored along with the users account information will be used to create and display an
ImageShieldVC for the user to select their categories.
Again, referring to the sample mybank application. The method that creates an ImageShield for a authentication
is shown below. It will instantiate a new ConfidentTechnologies object. Here you will use your own customerID,
siteID, apiUser, and apiPwd values given to you from ConfidentTechnologies (contact your sales rep for more
information). The final method called on the confTech object will request an ImageShield for user
authentication. Then, the ImageShieldDelegate protocol method “receiveImageShieldForAuthentication” will
receive the ImageShieldVC view controller object. Once we get this we present it as a modal view controller. The
user then will interact with the ImageShieldVC that is now on display. Notice that we release the ImageShieldVC
object after presentation, so later, when you remove it from display it will release its memory.
The user will eventually “Submit” their category selections which will be passed via the ImageShieldDelegate
protocol method “authenticationResult”. Here you will act on the success or failure of the ImageShield
authentication. You will dispose of the confTech object at the completion of this method.
-(void)submitLogin {
[self resignKeyboard];
NSString *user = ((UITextField *)[self viewWithTag:USER_TF]).text;
NSString *pwd = ((UITextField *)[self viewWithTag:PWD_TF]).text;
if( user && pwd && [user length] > 0 && [pwd length] > 0 ) {
if( [[LocalENV sharedInstance] authenticateUser:user pwd:pwd] ) {
//
// Auth was OK, Now have the user perform an ImageShield test
//
NSArray *userShields = [[LocalENVsharedInstance]
getUserImageShieldIDs:user];
NSString *bundle = [[LocalENV
sharedInstance]getUserImageShieldBundle:user];
// Request an ImageShield with users shields
confTech = [[ConfidentTechnologies alloc]
initCustomerID:@"a8xGbI7O"
siteID:@"icodeglobal"
apiUser:@"WLIybXjgc7Ebb65dAdIiQ6vUmMBIqndCzvmp8ABR"
apiPwd:@"bJIBLbb4XnnsVYD2H3Xuub1zhfcpFT5u7spM59C4"
delegate:self
currentView:self
265 Santa Helena Drive, Suite 105 • Solana Beach, CA 92075 • (858) 345-5640 • www.ConfidentTechnologies.com 5
];
//
// Set the Help Text
//
[confTech setHelpBannerText:@"ImageShield\xE2\x84\xA2"];
[confTech setHelpSubBannerText:@"Authentication"];
[confTech setHelpMainText:@"Use your finger to scroll through
the list of images and select those image categories that you saved when youcreated your profile.\n\nIf you forgot your
categories, click the \"ForgotCategories?\" button below."];
[confTech setHelpFooterText:@"Powered by ConfidentTechnologies"];
[confTech includeHelpForgotCategoriesButton];
// Now request the ImageShield for this user
[confTech createImageShieldToAuthenticateUser:user
shieldArray:userShields bundle:bundle];
//
// Receive the ImageShield in methodreceiveImageShieldForAuthentication
//
} else {
[[LocalENV sharedInstance] showAlert:@"Authentication Failed" msg:@"Check your user name and password."];
}
} else {
[[LocalENV sharedInstance] showAlert:@"Invalid Account" msg:@"User name and password must be populated."];
}
}
//
// The delegate will receive an ImageShieldVC that the user can display forAuthentication
//
-(void)receiveImageShieldForAuthentication:(ImageShieldVC *)imageShield {
[myBankVC presentModalViewController:imageShield animated:YES];
[imageShield release];
}
//
// Called when the user authenticates during login authentication// Also release the confTech object
//
-(void)authenticationResult:(BOOL)result {
NSLog(@"Authentication was %@",result ? @"Successfull" : @"Failed");
//
// Dismiss the ImageShieldGrid
//
[myBankVC dismissModalViewControllerAnimated:YES];
if( !result ) {
[self showLogin];
} else {
// user authentication with ImageShield was GOOD, now continue
// now that the user passed the test
[myBankVC showSuccessView];
}
[confTech release];
}
265 Santa Helena Drive, Suite 105 • Solana Beach, CA 92075 • (858) 345-5640 • www.ConfidentTechnologies.com 6