Sample Mobile Application API Reference

The sample mobile application uses the Login View Controller, User Dashboard View Controller, and Network Manager classes in Swift.

Login View Controller

All interaction between the sample application and the Oracle Identity Cloud Service SDK for iOS Applications happens through the LoginViewController.swift class.

  • The setupMSS() method creates a dictionary of initialization parameters to be used by the SDK, and it initializes the OMMobileSecurityService object by using those parameters. The sample application can use different browser modes to interact with Oracle Identity Cloud Service. In the setupMSS() method, you need to specify which browser mode you want to use.

  • The LoginViewController.swift class interacts with the Oracle Identity Cloud Service instance by using the OMMobileSecurityServiceDelegate protocol. This inner class contains callback methods for each action that the SDK performs.

  • The completedSetupWithConfiguration() method is called on the setup completion event which is triggered as a result of OMMobileSecurityService.setup() method.

  • The didReceiveAuthenticationChallenge() method is called on the challenge for authentication event which is triggered as a result of OMMobileSecurityService.authenticate() method.

  • The didFinishAuthentication() method is called on the authentication completion event which is triggered as a result of credential validation and redirection.

  • The didReceiveLogoutAuthenticationChallenge() method is called on the challenge for authentication event which is triggered as a result of the OMMobileSecurityService.logout() method.

  • The didFinishLogout() method is called on the logout completion event which is triggered as a result of logout validation and redirection.

  • The LoginViewController.swift implements the didReceiveLogoutAuthenticationChallenge method. This method calls the Oracle Identity Cloud Service logout URL using the browser type defined previously.

User Dashboard View Controller

After successful sign-in, the sample application displays the user screen, represented by the UserDashboardViewController.swift class.

Network Manager

All network calls to Oracle Identity Cloud Service are made by using the NetworkManager.swift singleton network class and callbacks by using the completion handler.

The NetworkManager.swift class implements functions to request the following information from Oracle Identity Cloud Service:

  • List of applications assigned to the user: HTTP call to the admin/v1/MyApps endpoint

  • List of groups assigned to the user: HTTP call to the admin/v1/MyGroups endpoint

  • Information of the logged in user: HTTP call to the admin/v1/Me endpoint