> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ulm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Associate social account to existing User

This is the standard use case delivered by the [Associate Social Account](c_associateSocial) Process.

An authenticated user associates a trusted third-party social account to their User ID. On the backend, the social association (or "social connection") is created and saved to the User entity.

\[product: dim]<img src="https://mintcdn.com/amdocs-ulm/XSI-_zBHRIt1HJAz/portal/m1Connect/processGuide/images/m1c_umlAssociateSocial.png?fit=max&auto=format&n=XSI-_zBHRIt1HJAz&q=85&s=ebc7708ea3f3ba6a8c0ce88a928dcc1c" alt="" width="895" height="1315" data-path="portal/m1Connect/processGuide/images/m1c_umlAssociateSocial.png" />\[/product: dim]

## Initial Request

Your client calls the [Process Start](c_processStart) API to initialize the Process:

```
**POST https://\{your.url\}/process/start/socialFederation.SocialMediaAssistedOnboarding.v1.0**
<no body>
```

## Response

Digital Identity Management responds with a request to specify the provider from a list of available options:

```
**RESPONSE - body**
{
   "processId": "13e6b3f4-7939-4fb7-a60f-cb09e852d430",
   "processName": "socialFederation.AssociateSocialMedia.v1.0",
   "displayMessage": "Please input required information",
   "parameters": {
      "providerId": "String"
   },
   "stepName": "ProviderPrompt",
   "lastStep": false,
   "output": {
      "providers": [
         "linkedin",
         "google",
         "facebook",
         "apple"
      ]
   }
}
```

| `processId` | Unique identifier for the current instance of this Process. |
| - | - |
| `processName` | Full name of the Process, including the category and version number. |
| `stepName` | Name of the specific step that the Process is currently on. |
| `lastStep` | Boolean that indicates whether or not this was the last step in the Process. |
| `displayMessage` | Optional message that the UI can display to the user. |
| `parameters` | Object that specifies the info this Process requires to continue its task. |
| `providerId` | The identifier of the social provider requested for social onboarding/authentication. |
| `output` | Object that contains data that the client can consume, retain, and use for additional operations. |
| `providers` | A list of available social providers supported by Digital Identity Management. |

## Next Request: Specify Provider

The client specifies the desired social provider, and passes that back to Digital Identity Management with the [Process Step](c_processStep) API:

```
**PUT https://\{your.url\}/process/step**
{
   "processId": "13e6b3f4-7939-4fb7-a60f-cb09e852d430",
   "parameters": {
      "providerId": "facebook"
   }
}
```

| `processId` | Unique identifier for the current instance of this Process. |
| - | - |
| `parameters` | Data object that contains the data request in the previous Process response. |
| `providerId` | The identifier of the social provider requested for social onboarding/authentication. |
| **Note:** See the parent topic for more details on how the client can specify the provider ID upfront in the initial request, and therefore skip this initial exchange step. | |

## Response

Digital Identity Management responds with a redirect URL for the client to follow:

```
**RESPONSE - body**{
   "processId": "13e6b3f4-7939-4fb7-a60f-cb09e852d430",
   "processName": "socialFederation.AssociateSocialMedia.v1.0",
   "displayMessage": "Please input required information",
   "stepName": "CodePrompt",
   "lastStep": false,
   "output": {
      "requestUrl": "https://www.facebook.com/dialog/oauth?response_type=code&client_id=<redacted>&state=<redacted>
                    &scope=public_profile%20email&redirect_uri=https%3A%2F%2Fidp-local.corp.amdocs.com%2Frest%2Fv70
                    %2Fprocess%2Fstep"
   }
}
```

| `processId` | Unique identifier for the current instance of this Process. |
| - | - |
| `processName` | Full name of the Process, including the category and version number. |
| `stepName` | Name of the specific step that the Process is currently on. |
| `lastStep` | Boolean that indicates whether or not this was the last step in the Process. |
| `displayMessage` | Optional message that the UI can display to the user. |
| `output` | Object that contains data that the client can consume, retain, and use for additional operations. |
| `requestUrl` | The URL to the social provider which a UI or other implementing client application is expected to redirect to, to complete authentication with the selected social provider. |

## Next Step: Redirect

The client expected to redirect to the URL provided in the `requestUrl` parameter. The user is then asked to authenticate to their social profile, and grant access for Digital Identity Management to read basic information (their name, email address, etc). The social provider then redirects back to Digital Identity Management with an authorization code, which Digital Identity Management independently verifies with the social provider back-end.

```
**GET /process/step?code=&lt;redacted&gt;&amp;state=&lt;redacted&gt;**
<no body>
```

## Response: Confirm Social Details

Digital Identity Management redirects back to the client, and passe along detail returned by the social provider. The Process requests for the user to confirm that this is the account that they want to associate:

```
**RESPONSE - body**
{
   "processId": "13e6b3f4-7939-4fb7-a60f-cb09e852d430",
   "processName": "socialFederation.AssociateSocialMedia.v1.0",
   "displayMessage": "Please input required information",
   "parameters": {
      "confirm": "boolean",
      "lastName": "string",
      "firstName": "string",
      "displayName": "string",
      "phone": "string",
      "email": "string",
   },
   "stepName": "ConfirmAssociationPrompt",
   "lastStep": false,
   "output": {
      "providerId": "facebook",
      "socialUserInfo": {
         "id": "1425242407805720",
         "email": "bob@example.com",
         "firstName": "Bob",
         "lastName": "Jones"
      }
   }
}
```

| `processId` | Unique identifier for the current instance of this Process. |
| - | - |
| `processName` | Full name of the Process, including the category and version number. |
| `stepName` | Name of the specific step that the Process is currently on. |
| `lastStep` | Boolean that indicates whether or not this was the last step in the Process. |
| `displayMessage` | Optional message that the UI can display to the user. |
| `parameters` | Object that specifies the info the Process requires to continue its task. Values maybe be pre-populated with `socialUserInfo` returned from the social provider. |
| `confirm` | Boolean that indicates the user's agreement to associate the social profile with their Digital Identity Management User ID. |
| `lastName` | **(Optional)** The user's last name. |
| `firstName` | **(Optional)** The user's first name. |
| `displayName` | **(Optional)** A display name for the user. This could be just a combination of the user's first and last name or a nickname. |
| `phone` | **(Conditional)** The user's mobile phone number. **Mandatory** if `email` is not provided. |
| `email` | **(Conditional)** The user's email address. **Mandatory** if `phone` is not provided. |
| `output` | Object that contains data that the client can consume, retain, and use for additional operations. |
| `providerId` | The identifier of the provider of the social account and associated data returned with it. |
| `socialUserInfo` | Object of user data given by the social provider. |
| `id` | The provider's unique identifier for the user's social account. **Note:** The client should not display this number to the end user. It is only provided here for context. |

## Final Request

The user confirms the association, and the client passes that choice to the Process with the [Process Step](c_processStep) API:

```
**PUT https://\{your.url\}/process/step**
{
   "processId": "13e6b3f4-7939-4fb7-a60f-cb09e852d430",
   "parameters": {
      "confirm": true,
      "lastName": "Jones",
      "firstName": "Bob",
      "email": "bob@example.com",
   }
}
```

| `processId` | Unique identifier for the current instance of this Process. |
| - | - |
| `parameters` | Object that contains the data requested in the previous Process response. |
| `confirm` | A boolean value indicative of the user's agreement to associate the social account with their Digital Identity Management profile. |
| `phone` | **(Conditional)** The user's mobile phone number. **Mandatory** if `email` is not provided. |
| `email` | **(Conditional)** The user's email address. **Mandatory** if `phone` is not provided. |

## Process Complete

The Process completes the association and returns a `200 HTTP` status:

```
**RESPONSE - body**
{
   "processId": "13e6b3f4-7939-4fb7-a60f-cb09e852d430",
   "processName": "socialFederation.AssociateSocialMedia.v1.0",
   "lastStep": true,
   "output": {
      "providerId":"facebook",
      "socialConnection": {
         "id": 1,
         "socialId": "1425242407805720",
         "providerId": "facebook"
      }
   }
}
```

| `processId` | Unique identifier for the current instance of this Process. |
| - | - |
| `processName` | Full name of the Process, including the category and version number. |
| `lastStep` | Boolean that indicates whether or not this was the last step in the Process. |
| `output` | Object that contains data that the client can consume, retain, and use for additional operations. |
| `providerId` | The identifier of the social provider providing the newly associated social profile. |
| `socialConnection` | Object of metadata related to the newly associated social profile. |
| `id` | Digital Identity Management's unique internal identifier for the new social association. |
| `socialId` | The provider's unique identifier for the user's social account. |
| `providerId` | Same value as `providerId` above. |
| The user now has the option to [authenticate with the associated social account](c_onboardAuthenticateUserSocial)[authenticate with the associated social account](c_onboardAuthenticateUserSocial). | |

**Parent topic:**[Associate Social Account to User Process](../topics/c_associateSocial)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.