---
title: Social IdP scripting API
description: The following bindings are available to social identity provider (IdP) scripts that are used by the following components:
component: pingoneaic
page_id: pingoneaic:am-scripting:social-idp-profile-transformation-api
canonical_url: https://docs.pingidentity.com/pingoneaic/am-scripting/social-idp-profile-transformation-api.html
keywords: ["Scripting"]
section_ids:
  legacy_api: Legacy API
  next_generation_api: Next-generation API
  bindings: Bindings
---

# Social IdP scripting API

The following bindings are available to social identity provider (IdP) scripts that are used by the following components:

* [Social IdP service](../am-authentication/social-idp-client-reference.html#transform-script) to transform the IdP's raw profile into a normalized object.

* [Social Provider Handler node](https://docs.pingidentity.com/auth-node-ref/latest/social-provider-handler.html) to transform the normalized profile into an identity or managed object.

* [OIDC ID Token Validator node](https://docs.pingidentity.com/auth-node-ref/latest/oidc-idtoken-validator.html) to map ID token attributes to local attributes.

|   |                                                                                                                                                                                                                                                                                                   |
| - | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | This script can be either a legacy or a next-generation script. It has access to all the [common bindings](script-bindings.html) for its scripting context.Learn about converting existing scripts in [Migrate OAuth scripts to next-generation scripts](access-token-modification-migrate.html). |

## Legacy API

For Legacy, the following bindings are available to the Social Identity Provider Profile Transformation script context:

* `jwtClaims`

* `normalizedProfile`

* `rawProfile`

* `requestHeaders`

* `requestParameters`

* `selectedIdp`

* `sharedState`

* `transientState`

## Next-generation API

For next-generation, scripting functionality is divided between the following contexts, each of which has access to a subset of the bindings:

| Context                                                    | Bindings                                                                          |
| ---------------------------------------------------------- | --------------------------------------------------------------------------------- |
| Social Identity Provider Profile Transformation (Next-Gen) | * `rawProfile`

* `requestHeaders`

* `requestParameters`

* `selectedIdp`        |
| Social Provider Handler Node                               | - `normalizedProfile`

- `requestHeaders`

- `requestParameters`

- `selectedIdp` |
| OIDC Node                                                  | * `jwtClaims`

* `requestHeaders`

* `selectedIdp`                                |

## Bindings

In addition to the common bindings, the social IdP scripts have access to the following bindings:

| Binding             | Description                                                                                                                                                                                                                                                                                                                                      | Legacy type                          | Next-generation type                                                                    |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------ | --------------------------------------------------------------------------------------- |
| `jwtClaims`         | The JWT claims.                                                                                                                                                                                                                                                                                                                                  | An object representing a JSON value. | Map of JSON value objects.*Only available to OIDC node scripts.*                        |
| `normalizedProfile` | The object that stores the normalized profile data.                                                                                                                                                                                                                                                                                              | An object representing a JSON value. | Map of JSON value objects.*Only available to Social Provider Handler node scripts.*     |
| `rawProfile`        | The object that stores the social IdP profile attributes in the format received by the provider.For example:```javascript
rawProfile.get('sub');
rawProfile.get('name');
rawProfile.get('given_name');
rawProfile.get('family_name');
rawProfile.get('picture');
rawProfile.get('email');
rawProfile.get('email');
rawProfile.get('locale');
``` | An object representing a JSON value. | Map of JSON value objects.*Only available to Social IdP Profile Transformation scripts* |
| `requestHeaders`    | Access the HTTP headers provided in the login request by calling:`String[] requestHeaders.get(String header)`.For example:```javascript
var hostName = requestHeaders.get("host").get(0);
```                                                                                                                                                    | Map\<String, List\<String>>          | Map\<String, List\<String>>                                                             |
| `requestParameters` | Access the HTTP request parameters provided in the login request by calling `String[] requestParameters.get(String param)`.For example:```javascript
var authType = requestParameters.get("authIndexType").get(0);
```                                                                                                                           | Map\<String, List\<String>>          | Map\<String, List\<String>>                                                             |
| `sharedState`       | Deprecated in favor of the common binding,`nodeState`.                                                                                                                                                                                                                                                                                           |                                      | *Not available*                                                                         |
| `selectedIdp`       | The social identity provider name. For example: `google`.                                                                                                                                                                                                                                                                                        | String                               | String                                                                                  |
| `transientState`    | Deprecated in favor of the common binding,`nodeState`.                                                                                                                                                                                                                                                                                           |                                      | *Not available*                                                                         |
