Simple Authentication

Simple authentication is an approach to authenticate customers once they provide their email address or custom ID. It allows for synchronization of data between Synerise and your database, ensuring consistency and an accurate profiling of customers. However, once you create a customer’s profile using this authentication method, it cannot be deleted.

The implementation of this authentication method is straightforward, requiring the usage of a single method. Unlike other authentication standards, it does not involve intercommunication between your application’s backend and Synerise’s backend. Instead, customer data is transmitted through a device for validation and authorization.

Additionally, in the Synerise platform (app.synerise.com) you can define the following settings:

Simple authentication proves particularly useful in scenarios when:

  • you have a large customer base
  • you don’t require OAuth, which in most cases is recommended
Important:

Currently this authentication is available only for:

  • Android (from 5.7.1 version)
  • iOS (from 4.14.0 version)
  • React Native (from 0.15.0 version)
  • Flutter(from 0.7.0 version)

Integration process


  1. In the Synerise platform (app.synerise.com), go to Settings > API keys and create or update the Profile key.
    1. In the Permissions section, enable the following permissions:
      • SAUTH_SIMPLE_AUTH_CREATE (the Auth group)
      • API_PERSONAL_INFORMATION_CLIENT_READ
      • SAUTH_LOGOUT_CLIENT_CREATE
    2. In the Simple authentication section, generate a salt by enabling the Simple authentication toggle. Copy the salt and save in the notepad.
    3. In the Profile modification allowlist section, allow modification of the following profile attributes:
      • UUID
      • email or customId (choose the identifier you will use in this method)
        Note: You can learn more about creating API keys in the Synerise platform here.
  2. Insert the salt from step 1 in the initialization script. Salt is used for the security reasons and for client-server validation in Simple Authentication.
    WARNING: It is your responsibility to ensure the secure storage of the salt in your application. We highly recommend keeping the salt encrypted.
    You can find the Synerise initialization scripts in the articles below:
  3. As a sign-in method, implement this method. In the customer’s data object, authId (unique identifier of a customer in your data base), email or customId parameters are required. As a result of this method, the client.simpleAuthLogin event is generated on the activity list of a customer in the Synerise platform in the Profiles mode.
    Click here to see the event body

    {
      "action": "client.simpleAuthLogin",
      "eventUUID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "unique": null,
      "createDate": 1689166104952,
      "label": "Simple auth client login",
      "params": {
        "ip": "xxx.xx.xxx.xx"
      }
    }

    A customer logged in with this method is assigned with a simple authentication token (a JWT) whose longevity you can define in the Synerise platform.
  4. To check if a customer is signed in through simple authentication, use this method.
    Important:

    To check if a customer is signed in with other authentication types, use these methods:

Authentication use cases


Use case Outcome
An anonymous customer signs in to a new account 1. Before signing in, a user is only assigned with UUID and clientId.
2. When signed in, they receive authID, and email and custom ID are assigned. The customer can update their data.
An anonymous customer signs in to an existing account 1. Before signing in, a user is only assigned with UUID and clientId.
2. A customer signs in to their account on the interface with their credentials (authID)
3. A customer is merged.
4. A customer is signed in and can update their data.
Signed-in customer signs in to a new account 1. A customer is already recognized.
2. A customer provides new sign-in credentials and the customer is signed in to a new account (a new account is created). This customer receives authID, and email and custom ID are assigned. The customer can update their data.
Signed-in customer signs in to an existing account 1. A customer is already recognized.
2. A customer re-signs in to other existing account on the interface with credentials (authID).
3. A customer is signs in and can update their data.

Troubleshooting


  • If the authID value is not unique, there is a risk of generating the same UUID for various customers which results in an error. This is because the UUID is generated based on the authID value
  • An error may occur when email or customId is not unique and there is an attempt to update a customer with other’s customer email or customId.

Best practices


Authentication methods


This method authenticates a customer with simple authentication.

OS Method
Android Client.simpleAuthentication(clientData, authId)
iOS Client.simpleAuthentication(data:authID:success:failure:)
React Native Synerise.Client.simpleAuthentication(data, authID, onSuccess, onError)
Flutter Synerise.client.simpleAuthentication(clientData, authId)
Note: authId/authID parameter is used for decreasion the number of UUID refreshes so it must be unique for every customer.

Other methods


Check if a customer is signed in

This method checks if a customer is signed in through simple authentication.

Important: This method returns false if a customer is authenticated through RaaS, oAuth, Facebook or Apple.
OS Method
Android Client.isSignedInViaSimpleAuthentication()
iOS Client.isSignedInViaSimpleAuthentication()
React Native Synerise.Client.isSignedInViaSimpleAuthentication()
Flutter Synerise.client.isSignedInViaSimpleAuthentication()

Customer sign out

This method signs out a customer from the mobile application.

OS Method
Android - Client.signOut()
- Client.signOut(mode, signOutFromAllDevices)
iOS - Client.signOut()
- Client.signOut(mode:fromAllDevices:success:failure:)
React Native - Synerise.Client.signOut()
- Synerise.Client.signOutWithMode(mode, fromAllDevices, onSuccess, onError)
Flutter Synerise.client.signOut()

What’s next


When the customer’s is signed in, you can implement profile management methods and session management methods.

😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker