High-level description of the Client Side Library calls

Mobile Connect button

The Client Side Library includes ClientSideController, that contains MobileConnect button actions
Click on this button should start following actions:

  • Attempt to get mobile network device IP
  • Attempt to get current SIM MCC/MNC
  • Attempt to get current SIM MSISDN
  • Send the request to the server side application with identified data
  • Perform redirects from the Server Side Application

After this actions completed - user should be authenticated on server side

High-level description of the SDK calls

Step 1: Discovery request

  • The startOperatorDiscoveryInController method is used for the Discovery request and Provider Metadata request via Discovery UI flow
  • The startOperatorDiscoveryForPhoneNumber method is used for the Discovery request and Provider Metadata request with identified MSISDN
  • The startOperatorDiscoveryWithCountryCode method is used for the Discovery request and Provider Metadata request with identified MCC/MNC pair
  • Discovery Service returns DiscoveryResponse and ProviderMetadata

Note: if you operate in the EU then you should use EU Discovery Service domain: eu.discover.mobileconnect.io

Step 2 – Create and send authentication/authorization requests:

  • The getTokenWithMobileConnectService method is used to create and send Authentication and Authorisation requests
  • Method returns auth code that will be used in token request.

Step 3: Create and send token request:

  • The getTokenWithCode method is used to create token request, send it and validate token as well.
  • Method returns token in tokenModel.

Step 4: Identity and UserInfo request - optional

  • The processUserInfoCompletionHandler and getAttributeInformation methods are used for Identity and UserInfo requests
  • Identity and Userinfo services return IdentityResponseUserinfo responses

Note: All methods do the similar consequence of steps. They differ in the input parameters only.

 

Function calls to Native API calls

startOperatorDiscoveryInController

startOperatorDiscoveryForPhoneNumber

startOperatorDiscoveryWithcountryCode

 

The Discovery call

startOperatorDiscoveryInController

startOperatorDiscoveryForPhoneNumber

startOperatorDiscoveryWithCountryCode

 

Discovery response

DiscoveryResponse {
 	(nullable) OperatorDataResponse *response; - operator data as specified below
	(nullable) NSString *correlation_id; - correlation_id parameter
	(nullable) NSString *subscriber_id; - subscriber_id parameter
	(nullable) NSNumber *ttl; - ttl parameter
	(nullable) OperatorIdModel *linksInformation; - contains links to operators’ endpoints
	(nullable) MetadataModel *metadata; - Provider Metadata response (R2 only)
}
OperatorIdModel {
    LinkModel* authenticationLink;
    LinkModel* tokenlink;
    LinkModel* refreshtokenlink;
    LinkModel* premiumInfoLink;
    LinkModel* userinfolink;
    LinkModel* jsonwebtokenlink; 
    LinkModel* metadatalink;
    LinkModel* scopeLink;
    LinkModel* revokeTokenLink;
}
OperatorDataResponse {
    APISModel *apis;
    NSString *client_id;
    NSString *client_secret;
    NSString *country;
    NSString *currency;
    NSString *serving_operator;
    NSString *subscriber_id;
    NSString *client_name;
}

 

getTokenWithCode call

 

getTokenWithCode response

TokenResponseModel object returned startAuthentication example:

TokenModel {
    (nullable) NSString *access_token; - access_token received from the IDGW
    (nullable) NSString *token_type; - OAuth 2.0 Token Type value 
    (nullable) NSString *id_token; - encrypted id_token received from the IDGW
    (nullable) NSString *expires_in; - expiration time of the access_token since the response was generated
    (nullable) NSString *refresh_token; - the refresh_token response parameter
}

TokenReponseModel {
    (nullable) TokenModel *tokenData; - the tokenModel received from the IDGW
    (nullable) NSDictionary *decodedToken; - decoded id_token
    (nullable) DiscoveryResponse *discoveryResponse; - the discoveryResponse data
}

 

Userinfo service calls

getAttributeServiceResponse (Discovery UI flow)

getAttributeServiceResponse (Discovery MSISDN flow)

getAttributeServiceResponse (Discovery MCC/MNC flow)

 

Userinfo response

UserInfoResponse object returned requestIdentity/requestUserinfo

UserInfoResponse{
	(nullable) NSString *sub;
	(nullable) NSString *family_name;
	(nullable) NSString *given_name;
	(nullable) NSString *phone_number;
	(nullable) NSString *updated_at;
	(nullable) AddressModel *address;
	(nullable) NSString *preferred_username;
	(nullable) NSString *email;
	BOOL email_verified;
	(nullable) NSString *nickname;
	(nullable) NSString *middle_name;
	(nullable) NSString *name;
	(nullable) NSString *correlation_id;
}

 

Identity service calls

getAttributeServiceResponse (Discovery UI flow)

getAttributeServiceResponse (Discovery MSISDN flow)

getAttributeServiceResponse (Discovery MCC/MNC flow)

 

Identity response

AttributeResponseModel object returned requestIdentity/requestUserinfo

AttributeResponseModel  {
	(nullable) NSString *sub;
	(nullable) NSString *family_name;
	(nullable) NSString *given_name;
	(nullable) NSString *national_identifier;
	(nullable) NSString *phone_number;
	(nullable) NSString *phone_number_alternate;
	(nullable) NSString *updated_at;
	(nullable) NSString *street_address;
	(nullable) NSString *city;
	(nullable) NSString *country;
	(nullable) NSString *state;
	(nullable) NSString *postal_code;
	(nullable) NSString *birthdate;
	(nullable) NSString *preferred_username;
	(nullable) NSString *email;
	(nullable) NSString *client_name;
	(nullable) NSString *id_token;
	(nullable) NSString *access_token;
	(nullable) NSString *middle_name;
	(nullable) NSString *title;
	BOOL email_verified;
}