
This article contains instruction to implement third parties approaches to authenticating a customer in a mobile application.

## Facebook Login
---
For those Applications that rely on Facebook Login as authentication, Synerise has a separate method that provides you with a Synerise JWT token based on Facebook login. Currently, there are no dedicated settings related to Facebook authentication on the user interface in the Synerise platform. You just have to implement RESTful API or SDK methods to authenticate through Facebook.



To authenticate a customer using Facebook, implement the following methods:

| OS           | Method                                                                                                                                                                                                                                                                                                                                                                                                                             |
|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Android      | - [Client.authenticate()](/developers/mobile-sdk/method-reference/android/client-authentication#authenticate-customer-by-identityprovider) |
| iOS          | - [Client.authenticate(token:clientIdentityProvider:authID:context:success:failure:)](/developers/mobile-sdk/method-reference/ios/client-authentication#authenticate-customer-by-identityprovider) <br> - [Client.authenticateConditionally(token:clientIdentityProvider:authID:context:success:failure:)](/developers/mobile-sdk/method-reference/ios/client-authentication#authenticate-customer-conditionally-by-identityprovider) |
| React Native | - [Synerise.Client.authenticate(token, clientIdentityProvider, authID, context, onSuccess, onError)](/developers/mobile-sdk/method-reference/react-native/client-authentication#authenticate-customer-by-identityprovider) <br> - [Synerise.Client.authenticateConditionally(token, clientIdentityProvider, authID context, onSuccess, onError)](/developers/mobile-sdk/method-reference/react-native/client-authentication#authenticate-customer-conditionally-by-identityprovider) |
| Flutter      | - [Synerise.client.authenticate(clientAuthContext, clientIdentityProvider, token)](/developers/mobile-sdk/method-reference/flutter/client-authentication#authenticate-customer-by-identityprovider)) |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authId/authID** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>


Additionally, in the Synerise platform (`app.synerise.com`) you can define the following settings:
- [Assignment of loyalty card](/docs/settings/tool/iam-for-apps/general#loyalty-card-assignment)
- [JWT longevity](/docs/settings/tool/iam-for-apps/general#jwt-lifetime)
- [Custom ID overwriting](/docs/settings/tool/iam-for-apps/general#custom-id-overwriting)
- [External ID overwriting](/docs/settings/tool/iam-for-apps/general#external-id-overwriting)


## Sign in with Apple
---

For integrating with the Apple platform, Synerise has a separate method that returns a Synerise JWT token based on Sign in with Apple credentials. You can read more about the configuration of the Sign in with Apple option in the Synerise platform [here](/docs/settings/tool/iam-for-apps/third-party#apple).

In this case, the authentication process works in the following way:

1. A customer authenticates by Sign in with Apple.
2. Apple provides authentication credentials.
3. Your app uses these credentials and creates `ClientAppleSignInAuthenticationContext`.
4. The context is passed to Synerise by using:

    | OS           | Method                                                                                                                                                                                                                                                                                                                                                                                                                              |
    |--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
    | iOS          | - [Client.authenticate(token:clientIdentityProvider:authID:context:success:failure:)](/developers/mobile-sdk/method-reference/ios/client-authentication#authenticate-customer-conditionally-by-identityprovider) <br> - [Client.authenticateConditionally(token:clientIdentityProvider:authID:context:success:failure:)](/developers/mobile-sdk/method-reference/ios/client-authentication#authenticate-customer-conditionally-by-identityprovider) |
    | React Native | - [Synerise.Client.authenticate(token, clientIdentityProvider, authID, context, onSuccess, onError)](/developers/mobile-sdk/method-reference/react-native/client-authentication#authenticate-customer-by-identityprovider) <br> - [Synerise.Client.authenticateConditionally(token, clientIdentityProvider, authID context, onSuccess, onError)](/developers/mobile-sdk/method-reference/react-native/client-authentication#authenticate-customer-conditionally-by-identityprovider) |
    | Flutter      | - [Synerise.client.authenticate(clientAuthContext, clientIdentityProvider, token)](/developers/mobile-sdk/method-reference/flutter/client-authentication#authenticate-customer-by-identityprovider)) |


   <div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   **authId/authID** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

   </div></div></div>


5. If the authentication was successful, Synerise provides your application with our JWT access token for the customer.

Additionally, in the Synerise platform (`app.synerise.com`) you can define the following settings:
- [Assignment of loyalty card](/docs/settings/tool/iam-for-apps/general#loyalty-card-assignment)
- [JWT longevity](/docs/settings/tool/iam-for-apps/general#jwt-lifetime)
- [Custom ID overwriting](/docs/settings/tool/iam-for-apps/general#custom-id-overwriting)
- [External ID overwriting](/docs/settings/tool/iam-for-apps/general#external-id-overwriting)

## The list of methods
---

### Check if a customer is signed in

This method checks if a customer is signed in through oAuth, Facebook, Sign in with Apple, or RaaS.


<div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

This method returns `false` if a customer is authenticated through [Simple Profile Authentication](/developers/mobile-sdk/user-identification-and-authorization/simple-authentication).

</div></div></div>


| OS           | Method                                                                                                                                    |
|--------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| Android      | [Client.isSignedIn()](/developers/mobile-sdk/method-reference/android/client-authentication#check-if-a-customer-is-signed-in-via-raas-oauth-facebook-apple)                |
| iOS          | [Client.isSignedIn()](/developers/mobile-sdk/method-reference/ios/client-authentication#check-if-a-customer-is-signed-in-via-raas-oauth-facebook-apple) |
| React Native | [Synerise.Client.isSignedIn()](/developers/mobile-sdk/method-reference/react-native/client-authentication#check-if-a-customer-is-signed-in-via-raas-oauth-facebook-apple)       |
| Flutter | [Synerise.client.isSignedIn()](/developers/mobile-sdk/method-reference/flutter/client-authentication#check-if-a-customer-is-signed-in-via-raas-oauth-facebook-apple)      |

### Customer sign out
This method signs out the customer. The method terminates the JWT token and ends the customer session.

| OS           | Method                                                                                                                |
|--------------|-----------------------------------------------------------------------------------------------------------------------|
| Android      | - [Client.signOut()](/developers/mobile-sdk/method-reference/android/client-authentication#sign-out-customer) <br/> -  [Client.signOut(mode, signOutFromAllDevices)](/developers/mobile-sdk/method-reference/android/client-authentication#sign-out-customer-with-mode-or-from-all-devices) |
| iOS          | - [Client.signOut()](/developers/mobile-sdk/method-reference/ios/client-authentication#sign-out-customer) <br/> - [Client.signOut(mode:fromAllDevices:success:failure:)](/developers/mobile-sdk/method-reference/ios/client-authentication#sign-out-customer-with-mode-or-from-all-devices) |
| React Native | - [Synerise.Client.signOut()](/developers/mobile-sdk/method-reference/react-native/client-authentication#sign-out-a-customer) <br/> - [Synerise.Client.signOutWithMode(mode, fromAllDevices, onSuccess, onError)](/developers/mobile-sdk/method-reference/react-native/client-authentication#sign-out-customer-with-mode-or-from-all-devices) |
| Flutter | [Synerise.client.signOut()](/developers/mobile-sdk/method-reference/flutter/client-authentication#sign-out-a-customer) |

## What's next
---
When the customer's is signed in, you can implement [profile management methods](/developers/mobile-sdk/user-identification-and-authorization/identification-and-user-management#profile-management-methods) and [session management methods](/developers/mobile-sdk/user-identification-and-authorization/session-management).

