# Social Login

Login users using social login providers like Google Sign-In. This implements a backend-to-backend integration for authentication. Irrespective of the social login provider, the flow includes three steps: initiating a login, submitting the received code to Mosaic, and finally completing authentication with Mosaic.


## Servers

Sandbox environment
```
https://api.sbx.transmitsecurity.io/cis
```

Production environment (US)
```
https://api.transmitsecurity.io/cis
```

Production environment (EU)
```
https://api.eu.transmitsecurity.io/cis
```

Production environment (CA)
```
https://api.ca.transmitsecurity.io/cis
```

Production environment (AU)
```
https://api.au.transmitsecurity.io/cis
```

## Security

### bearer

Type: http
Scheme: bearer
Bearer Format: JWT

### UserAccessToken

A token returned upon end-user authentication, which provides access to resources and data for the user and app for which it was generated

Type: http
Scheme: bearer
Bearer Format: JWT

### AdminAccessToken

A token generated by a management application using the [token endpoint](/openapi/token.openapi/other/getaccesstoken). It provides access to all resources for the tenant and its apps

Type: oauth2

### ClientAccessToken

A token generated by an end-user application using the [token endpoint](/openapi/token.openapi/other/getaccesstoken). It provides access to resources and data on the tenant level or associated with the specific application (but not other apps in the tenant)

Type: oauth2

### OrgAdminAccessToken

A token returned upon B2B authentication for a user that has the organizationAdmin or organizationCreator role.

Type: oauth2

## Download OpenAPI description

[Social Login](https://developer.transmitsecurity.com/_bundle/openapi/user/backend-social-login.openapi.yaml)

## Other

### Start login with Google

 - [POST /v1/auth/social/google/start](https://developer.transmitsecurity.com/openapi/user/backend-social-login.openapi/other/initgooglelogin.md): Starts the Google login flow. This call returns an authorization URL to redirect the user to.

### Complete login with Google

 - [POST /v1/auth/social/google/authenticate](https://developer.transmitsecurity.com/openapi/user/backend-social-login.openapi/other/authenticategooglelogin.md): Completes the Google social login flow and authenticates the user in Mosaic.

### Start login with Facebook

 - [POST /v1/auth/social/facebook/start](https://developer.transmitsecurity.com/openapi/user/backend-social-login.openapi/other/initfacebooklogin.md): Starts the Facebook login flow. This call returns an authorization URL to redirect the user to.

### Complete login with Facebook

 - [POST /v1/auth/social/facebook/authenticate](https://developer.transmitsecurity.com/openapi/user/backend-social-login.openapi/other/authenticatefacebooklogin.md): Completes the Facebook social login flow and authenticates the user in Mosaic.

### Start login with Apple

 - [POST /v1/auth/social/apple/start](https://developer.transmitsecurity.com/openapi/user/backend-social-login.openapi/other/initapplelogin.md): Starts the Apple login flow. This call returns an authorization URL to redirect the user to.

### Complete login with Apple

 - [POST /v1/auth/social/apple/authenticate](https://developer.transmitsecurity.com/openapi/user/backend-social-login.openapi/other/authenticateapplelogin.md): Completes the Apple social login flow and authenticates the user in Mosaic.

### Start login with Tiktok

 - [POST /v1/auth/social/tiktok/start](https://developer.transmitsecurity.com/openapi/user/backend-social-login.openapi/other/inittiktoklogin.md): Starts the Tiktok login flow. This call returns an authorization URL to redirect the user to.

### Complete login with Tiktok

 - [POST /v1/auth/social/tiktok/authenticate](https://developer.transmitsecurity.com/openapi/user/backend-social-login.openapi/other/authenticatetiktoklogin.md): Completes the Tiktok social login flow and authenticates the user in Mosaic.

### Submit code from Google

 - [POST /v1/auth/social/google/verify](https://developer.transmitsecurity.com/openapi/user/backend-social-login.openapi/other/verifygoogletoken.md): Submits the authorization code returned by Google to exchange for user identity information

### Submit code from Facebook

 - [POST /v1/auth/social/facebook/verify](https://developer.transmitsecurity.com/openapi/user/backend-social-login.openapi/other/verifyfacebooktoken.md): Submits the authorization code returned by Facebook to exchange for user identity information

### Submit code from Apple

 - [POST /v1/auth/social/apple/verify](https://developer.transmitsecurity.com/openapi/user/backend-social-login.openapi/other/verifyappletoken.md): Submits the authorization code returned by Apple to exchange for user identity information

### Submit code from TikTok

 - [POST /v1/auth/social/tiktok/verify](https://developer.transmitsecurity.com/openapi/user/backend-social-login.openapi/other/verifytiktoktoken.md): Submits the authorization code returned by TikTok to exchange for user identity information

