---
title: IDP adapter scripting API
description: "Use server-side scripts to customize PingAM's SAML2 IDP adapter behavior and access authentication requests, responses, and session information"
component: pingam
version: 8
page_id: pingam:am-scripting:saml2-idp-adapter-api
canonical_url: https://docs.pingidentity.com/pingam/8.1/am-scripting/saml2-idp-adapter-api.html
llms_txt: https://docs.pingidentity.com/pingam/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
revdate: 2026-06-01T14:34:20Z
page_aliases: ["scripting-guide:saml2-idp-adapter-api.adoc"]
superseded_by: https://docs.pingidentity.com/pingam/8.1/am-scripting/saml2-idp-adapter-api.html
---

# IDP adapter scripting API

|   |                                                                                                                                                                     |
| - | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | The IDP adapter script is a legacy script and therefore has access to all the *legacy* [common bindings](script-bindings.html) in addition to those described here. |

| Binding                  | Description                                                                                                                                                                                                                                                                                                                                         |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `authnRequest`           | The original authentication request sent from the SP. Not available to the `preSendFailureResponse` function. Refer to [AuthnRequest](../_attachments/apidocs/com/sun/identity/saml2/protocol/AuthnRequest.html).                                                                                                                                   |
| `faultCode`              | The fault code returned in the SAML response.Only available to the `preSendFailureResponse` function.                                                                                                                                                                                                                                               |
| `faultDetail`            | Contains the details of the fault returned in the SAML response.Only available to the `preSendFailureResponse` function.                                                                                                                                                                                                                            |
| `hostedEntityId`         | The entity ID for the hosted IDP.                                                                                                                                                                                                                                                                                                                   |
| `idpAdapterScriptHelper` | The [idpAdapterScriptHelper](../_attachments/apidocs/com/sun/identity/saml2/plugins/scripted/IdpAdapterScriptHelper.html) instance contains supporting methods that provide context information when customizing the IDP adapter plugin points.Always present.                                                                                      |
| `relayState`             | A String representing the relayState used in the redirect.Not available to the `preSingleSignOn` or `preSendFailureResponse` functions.                                                                                                                                                                                                             |
| `reqId`                  | The id to use for continuation of processing if the adapter redirects.Not available to the `preSignResponse` or `preSendFailureResponse` functions.                                                                                                                                                                                                 |
| `request`                | The `HttpServletRequest` object. Always present.                                                                                                                                                                                                                                                                                                    |
| `res`                    | The SAML response. For information, refer to [Response](../_attachments/apidocs/com/sun/identity/saml2/protocol/Response.html).Only available to the `preSignResponse` function.                                                                                                                                                                    |
| `response`               | The `HttpServletResponse` object.Not available to the `preSignResponse` function.                                                                                                                                                                                                                                                                   |
| `session`                | Not available to the `preSingleSignOn` or `preSendFailureResponse` functions.Contains a representation of the user's single sign-on session object. Refer to the [SSOToken](../_attachments/apidocs/com/iplanet/sso/SSOToken.html) interface for information about SSO token and authentication information, as well as session-related properties. |
