Show TOC

Developing with MAF Logon for iOSLocate this document in the navigation structure

MAF logon components implement user onboarding workflows.

The logon components provide:
  • User-initiated registration requests to various security infrastructures
  • Access control with app-specific passcodes that adhere to policies specified in SAP Mobile Platform
  • Secure store to protect sensitive information, for example, logon credentials
  • Credential management, for example, changing the app passcode and the back-end password to enhance security in an enterprise environment
  • SAML-based authentication
  • Certificate-based logon with certiticates acquired from Afaria or a third-party certificate provider
  • Onboarding with configuration provided by Afaria or SAP Mobile Place
  • Various customization options

MAF logon components include the MAF Logon UI and the MAF Logon Manager. MAF Logon UI presents logon screens on the device, providing easy integration for applications that use default logon UI behavior. While MAF Logon UI constructs a dynamic UI from context elements, MAF Logon Manager executes operations and constructs UI contexts to be presented by MAF Logon UI.

Completion Blocks in the MAF Libraries

A completion block is a piece of code that executes when a request completes. You can use a completion block to replace the delegate-based APIs that use callback functions to handle requests and server responses.

For example, to open an Online store:
[_onlineStore openStore:^(id<SODataStoreAsync> store, NSError *error) {
	if(error)
	{   //error handling goes here   }
	else
	{   //store opens and proceed    } } ];
Or to schedule a request:
SODataRequestParamSingleDefault* requestParam = [[SODataRequestParamSingleDefault alloc] 
initWithMode:SODataRequestModeRead resourcePath:ENTITY_READ_URL];

[_onlineStore scheduleRequest:requestParam completion:^(id<SODataRequestExecution>
requestExecution, NSError *error) {
   if(error)
   {//error handling goes here   }
   else
   { id<SODataResponseSingle> responseSingle = (id<SODataResponseSingle>)requestExecution.response;
      if ([responseSingle.payload conformsToProtocol:@protocol(SODataEntitySet) ])
      {
      self.entitySet = (id<SODataEntitySet>)responseSingle.payload;
      NSLog(@"Got %lu entries.",(unsigned long)self.entitySet.entities.count );}}}];

SAP recommends you exclusively use either completion blocks or delegate-based APIs; that is, do not mix the two.

For details, see the Native OData API that is installed with the SDK. Also, for information about working with blocks, see https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.htmlInformation published on non-SAP site.