Loading
Salesforce から送信されるメールは、承認済ドメインからのみとなります続きを読む

HAR ファイルから SAML アサーション XML を抽出する方法

公開日: Nov 19, 2024
タスク

目標

Anypoint Platform への SAML ベースのシングルサインオン (SSO) のトラブルシューティングを行うには、多くの場合、リクエストから SSO SAML アサーションの詳細を抽出する必要があります。この記事では、Anypoint Platform への SSO 実行時にキャプチャされた HAR ファイルからこれを行う手順について説明します。
ステップ

以下のサポート対象のブラウザーで作成する前に、HAR セキュリティガイドラインをお読みください

HAR (http アーカイブ) ファイルには、Cookie、認証トークン、個人情報などの秘密データが含まれている場合があります。このデータは、なりすましや不正アクセスなどのセキュリティリスクにつながる可能性があります。 

HAR ファイルを作成する場合、顧客は、ファイルを Salesforce サポートおよびサードパーティベンダーに送信する前に、次の安全策を完了していることを確認する必要があります。

  1. サニタイズ:ファイルを共有する前に、HAR サニタイズ (例 -Cloudflare HAR Sanitizer) を使用するか、テキストエディタを使用して手動でサニタイズすることで秘密情報を削除します。
  2. セッションからのログアウト:認証以外の問題を調査する場合は、記録する前にアクティブセッションからログアウトすることでセキュリティを強化し、アクティブセッショントークンのキャプチャを防ぎます。
  3. HAR のハイジーン:HAR ファイルに制限をかけます。適切な担当者にのみアクセスを制限し、安全な保管と転送を確保します。HAR ファイルは、サニタイズされていない状態で Salesforce の外部 (例: chatGPT) に絶対にアップロードしないでください

 

ステップ 1: Anypoint Platform への SSO を実行するときに、ナレッジ記事「How to retrieve HTTP archive files (HAR)」(HTTP アーカイブファイル (HAR) を取得する方法) に従います。

ステップ 2: HAR ファイルがキャプチャされたら、https://anypoint.mulesoft.com/accounts/login/receive-id へのリクエストを検索し、パラメータ「SAMLResponse」の値を見つけます。これは長い文字列です。

次に例を示します。
 

"request": {
          "method":"POST",
          "url": "https://anypoint.mulesoft.com/accounts/login/receive-id",
          "httpVersion":"HTTP/1.1",
          ...
          "postData": {
            "mimeType": "application/x-www-form-urlencoded",
            "text":"SAMLResponse=PD94b...&RelayState=",
            "params": [
              {
                "name":"SAMLResponse",
                "value":"PD94b..."
              },
              {
                "name":"RelayState",
                "value": ""
              }
            ]
          }
        },


ステップ 3: 長い文字列をコピーし、URL デコードを行います。


https://www.urldecoder.org/ を使用してデコードできます。


ステップ 4: URL デコードされた文字列をコピーし、base64 デコードを行います。


https://www.base64decode.org/ を使用してデコードできます。

この出力は、次のような人間が読める形式の SAML アサーション XML です。
<?xml version="1.0" encoding="UTF-8"?>
<saml2p:Response Destination="https://anypoint.mulesoft.com/accounts/login/receive-id" ID="id102899906075521711077394618" IssueInstant="2020-10-06T00:49:08.454Z" Version="2.0" xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">http://www.okta.com/xxxxxxxxxxxxxxxxxxxxx</saml2:Issuer>
	<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
		<ds:SignedInfo>
			<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
			<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
			<ds:Reference URI="#id102899906075521711077394618">
				<ds:Transforms>
					<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
					<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
						<ec:InclusiveNamespaces PrefixList="xs" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
					</ds:Transform>
				</ds:Transforms>
				<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
				<ds:DigestValue>...</ds:DigestValue>
			</ds:Reference>
		</ds:SignedInfo>
		<ds:SignatureValue>...</ds:SignatureValue>
		<ds:KeyInfo>
			<ds:X509Data>
				<ds:X509Certificate>...</ds:X509Certificate>
			</ds:X509Data>
		</ds:KeyInfo>
	</ds:Signature>
	<saml2p:Status xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol">
		<saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
	</saml2p:Status>
	<saml2:Assertion ID="id102899906076315621983006756" IssueInstant="2020-10-06T00:49:08.454Z" Version="2.0" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xs="http://www.w3.org/2001/XMLSchema">
		<saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">http://www.okta.com/xxxxxxxxxxxxxxxxxxxxx</saml2:Issuer>
		<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
			<ds:SignedInfo>
				<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
				<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
				<ds:Reference URI="#id102899906076315621983006756">
					<ds:Transforms>
						<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
						<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
							<ec:InclusiveNamespaces PrefixList="xs" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
						</ds:Transform>
					</ds:Transforms>
					<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
					<ds:DigestValue>...</ds:DigestValue>
				</ds:Reference>
			</ds:SignedInfo>
			<ds:SignatureValue>...</ds:SignatureValue>
			<ds:KeyInfo>
				<ds:X509Data>
					<ds:X509Certificate>...</ds:X509Certificate>
				</ds:X509Data>
			</ds:KeyInfo>
		</ds:Signature>
		<saml2:Subject xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">
			<saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">sean.li@mulesoft.com</saml2:NameID>
			<saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
				<saml2:SubjectConfirmationData NotOnOrAfter="2020-10-06T00:54:08.454Z" Recipient="https://anypoint.mulesoft.com/accounts/login/receive-id"/>
			</saml2:SubjectConfirmation>
		</saml2:Subject>
		<saml2:Conditions NotBefore="2020-10-06T00:44:08.454Z" NotOnOrAfter="2020-10-06T00:54:08.454Z" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">
			<saml2:AudienceRestriction>
				<saml2:Audience>anypoint.mulesoft.com</saml2:Audience>
			</saml2:AudienceRestriction>
		</saml2:Conditions>
		<saml2:AuthnStatement AuthnInstant="2020-10-06T00:49:08.454Z" SessionIndex="id1601945348452.291824165" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">
			<saml2:AuthnContext>
				<saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml2:AuthnContextClassRef>
			</saml2:AuthnContext>
		</saml2:AuthnStatement>
		<saml2:AttributeStatement xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">
			<saml2:Attribute Name="firstname" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
				<saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Sean</saml2:AttributeValue>
			</saml2:Attribute>
			<saml2:Attribute Name="lastname" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
				<saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Li</saml2:AttributeValue>
			</saml2:Attribute>
			<saml2:Attribute Name="email" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
				<saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">sean.li@mulesoft.com</saml2:AttributeValue>
			</saml2:Attribute>
			<saml2:Attribute Name="group" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
				<saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">...</saml2:AttributeValue>
				<saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">...</saml2:AttributeValue>
			</saml2:Attribute>
		</saml2:AttributeStatement>
	</saml2:Assertion>
</saml2p:Response>



 

 

ナレッジ記事番号

001115955

 
読み込み中
Salesforce Help | Article