How To
Summary
This document explains how to capture the SAML response (assertion) that an identity provider (IdP) sends when a user logs in to HCP Terraform or Terraform Enterprise. Attributes in the assertion are used to map the login to a user and assign permissions such as team, organization, and site‑admin membership.
Steps
Introduction
This document explains how to capture the SAML response (assertion) that an identity provider (IdP) sends when a user logs in to HCP Terraform or Terraform Enterprise. Attributes in the assertion are used to map the login to a user and assign permissions such as team, organization, and site‑admin membership.
Use Case
When troubleshooting SAML sign‑on problems for HCP Terraform or Terraform Enterprise, you must capture the SAML assertion to see which attributes the IdP provides. This information is essential for diagnosing common login failures.
Procedure
The method for capturing a SAML assertion varies by browser. The steps below cover three major browsers; decoding the response is described later.
Capturing an Assertion in Google Chrome (as of 89.0.4389.90)
- Navigate to the HCP Terraform or Terraform Enterprise login page.
- Click “Sign in with SSO”.
- For HCP Terraform, enter the name of an organization that has SAML enabled.
- Open the Chrome menu (three dots) to the right of the address bar and select More Tools > Developer Tools.
- Select the Network tab and enable the Preserve Log checkbox.
- Complete the SAML sign‑in flow.
- In the Network tab, locate the request named
acs(for HCP Terraform) orauth(for Terraform Enterprise). - Scroll to the bottom of the details pane and review the Form Data section. The base64‑encoded SAML assertion appears as the
SAMLResponse. - Save the response string for decoding in the next section.
Capturing an Assertion in Mozilla Firefox (as of 87.0)
- Navigate to the HCP Terraform or Terraform Enterprise login page.
- Click “Sign in with SSO”.
- For HCP Terraform, enter the name of an organization that has SAML enabled.
- Open Web Developer Tools via Tools > Web Developer > Web Developer Tools and select the Network tab.
- Click the gear icon in the upper‑right of the pane and enable Persist Logs.
- Complete the SAML sign‑in flow.
- In the Web Developer pane, find the POST request to
app.terraform.iofor a file namedacs(for HCP Terraform). For Terraform Enterprise, locate the POST request to the Enterprise hostname for a file namedauth. - Click the request to view its details.
- In the Request tab, locate the Form data section containing the
SAMLResponseparameter. This value is the base64‑encoded SAML assertion. - Save the response string for decoding in the next section.
Capturing an Assertion in Apple Safari (as of 14.0.3)
First, enable the Develop menu.
- Open Safari preferences (Safari > Preferences).
- Select the Advanced tab.
- Check the Show Develop menu in menu bar option.
After enabling the Develop menu, capture the SAML assertion as described below.
- Navigate to the HCP Terraform or Terraform Enterprise login page.
- Click “Sign in with SSO”.
- For HCP Terraform, enter the name of an organization that has SAML enabled.
- From the Safari Develop menu, open the Web Inspector and select the Network tab.
- In the upper‑right corner of the inspector, enable the Preserve Log option.
- Complete the SAML sign‑in flow.
- In the inspector, locate and click the document titled with your HCP Terraform organization name. For Terraform Enterprise, the document title is
app. - Select the Headers tab and scroll to the bottom to find the Request Data section.
- Copy all text between
SAMLResponse=and&RelayState=. This is the base64‑ and URI‑encoded SAML assertion. - Save the response string for decoding in the next section.
Decoding the Assertion
After retrieving the base64‑encoded assertion from the browser, decode it to human‑readable XML.
macOS and Linux
Save the base64 string to a file, open a terminal, and run:
$ echo $ENCODED_RESPONSE | base64 --decode
Safari assertions are also URI‑encoded. Replace all %2B with + before decoding.
$ echo $ENCODED_RESPONSE | sed 's/%2B/\+/g' | base64 --decode
Windows
Save the base64 string to a file, open Command Prompt, and run:
certutil -decode C:\path\to\encoded_saml_response.txt C:\path\to\decoded_saml_response.txt
Additional Information
Third‑party tools such as the SAML Tracer add‑on for Firefox or Chrome can simplify capturing and decoding SAML assertions. Use these tools if you perform this task regularly or encounter issues with the steps in this article.
- HCP Terraform: Configure and manage single sign‑on
- Terraform Enterprise: Configure Terraform Enterprise as the SAML service provider
Document Location
Worldwide
Historical Number
1500005371682
Was this topic helpful?
Document Information
Modified date:
22 October 2026
UID
ibm17265208