Tutorial: Mobile implicit login

Serverless AuthenticationSigning in and out Mobile implicit login

This authentication method provides an implicit authentication of any mobile end-user who is an Orange customer. It relies on the Orange Wassup platform, which makes it possible to identify Orange customers based on the mobile data network (typically Orange 3G network) used by their mobile device, without requiring any explicit interaction with the final user.

As any project that uses the Orange Wassup platform must be formally approved, this method is not available by default on newly created Webcom applications. In order to make it available for your application, you have to request it explicitly by sending an email to a Webcom administrator.

This method is intended for mobile devices accessing the internet through a mobile data network. It will fail if called from a non-mobile device or through a Wi-Fi network.

This authentication method is not available in all Orange countries, in particular it doesn't work in France.
See the complete list of supported countries for more details.

Implicit login

// const app = Webcom.App("<your-app>"); // UNCOMMENT if you haven't yet an instance of your app!
// Get an instance of the authentication service
const auth = app.authentication;
// Sign in
auth.signInWithWassup({mcc: "206"})
    .then(authDetails => console.log("Authentication succeeded", authDetails))
    .catch(error => {
        switch (error.code) {
           case "INVALID_PROVIDER_REQUEST":
             console.log("Your mobile network access could not be recognized.");
             break;
           case "PROVIDER_DISABLED":
             console.log("The implicit authentication method is disabled in the application. It must be enabled in the Webcom developer console.");
             break;
           default:
             console.log("An unexpected error occurs, please retry and contact your administrator.", error);
         }
    });

Unless you run a Javascript application on a mobile device, the Javascript API for implicit login should not be used directly.

Nevertheless, the authWithWassup function expects a JSON object as a first argument, with a mcc property that indicates the Mobile Country Code attached to the mobile device.

The authDetails parameter returned by the promise is a JSON object representing the signed in identity, which directly feeds the current authentication state. The following properties are specialized this way:

Property Type Description
provider string Equals "wassup".
providerUid string An immutable identifier of the authenticated mobile device.
Note that this identifier is application-specific, so that the same user receives two distinct identifiers when authenticating from two distinct Webcom applications.
val myApp = WebcomApplication.default // the app defined by the 'webcom.properties' asset file
val authenticator = myApp.authenticationService

authenticator
    .getOrangeMobileNetworkMethod()
    .authenticate { // it: WebcomResult<AuthenticationDetails>
        when (it) {
            is WebcomResult.Success -> print("logged in with the token: ${it.result.authenticationToken}")
            is WebcomResult.Failure -> print("error: ${it.error.errorCode}")
        }
    }

The getOrangeMobileNetworkMethod() method automatically retrieves the Mobile Country Code from the SIM card activated on the mobile device. An explicit MCC can also be passed (as a String) to this method, in order to perform the authentication with an arbitrary MCC.

let authenticationService = Webcom.defaultApplication.authenticationService
let implicitMethod = AuthenticationMethodOrangeMobileNetwork()
authenticationService.authenticate(with: implicitMethod) { result in
    switch result {
    case let .success(details):
        print("Logged in with the account:", details.uid)
    case let .failure(error):
        print("Error:", error)
    }
}

By default, the initializer of AuthenticationMethodOrangeMobileNetwork retrieves the Mobile Country Code from the SIM card activated on the mobile device. It is also possible to manually specified an arbitrary MCC to perform the authentication.

Currently supported countries

The Orange mobile network of the following countries is currently supported for implicit login based on the Orange Wassup platform:

Country Mobile Country Code (MCC)
EUROPE
Belgium 206
Poland 260
Slovakia 231
Spain 214
United-Kingdom 234
MIDDLE-EAST
Jordan 416
AFRICA
Botswana 652
Cameroon 624
Central African Republic 623
Congo-Kinshasa 630
Egypt 602
Guinea-Bissau 632
Guinea-Conakry 611
Ivory Coast 612
Madagascar 646
Mali 610
Morocco 604
Niger 614
Senegal 608
Tunisia 605