Loading

HAR 파일에서 SAML Assertion XML을 추출하는 방법

게시 일자: Nov 19, 2024
과업

목표

애니포인트 플랫폼에 대한 SAML 기반 싱글사인온 (SSO) 문제를 해결하려면 요청에서 SSO SAML 주장 세부 정보를 추출해야 하는 경우가 많습니다. 이 문서에서는 싱글사인온 시 캡처한 HAR 파일부터 애니포인트 플랫폼까지 수행하는 단계를 설명합니다.
단계

아래 지원되는 브라우저에서 작성하기 전에 HAR 보안 가이드라인을 읽어보세요

HAR (http archive) 파일에는 쿠키, 인증 토큰 및 개인 정보를 포함한 민감한 데이터가 포함될 수 있습니다. 이 데이터는 사칭 및 무단 액세스와 같은 보안 위험을 초래할 수 있습니다. 

HAR 파일을 작성할 때 고객은 파일이 Salesforce 지원 및 타사 공급업체로 전송되기 전에 다음과 같은 안전 조치가 완료되었는지 확인해야 합니다.

  1. 소독: 공유하기 전에 HAR 소독 ( 예 -클라우드플레어 HAR 살균제) 을 사용하거나 텍스트 편집기로 파일을 수동으로을 소독하여 민감한 정보를 수정합니다.
  2. 세션 로그아웃: 인증되지 않은 문제를 조사하는 경우, 보안을 강화하고 활성 세션 토큰을 캡처하지 못하도록 레코드하기 전에 활성 세션에서 로그아웃합니다.
  3. HAR 위생: HAR 파일을 제한된 파일로 취급합니다. 적절한 인원만 액세스할 수 있도록 제한하고 안전한 보관 및 전송을 보장합니다. HAR 파일을 Salesforce 외부(예: chatGPT)에 소독되지 않은 상태로 업로드해서는 안 됩니다.

 

단계 1, 애니포인트 플랫폼에 대한 싱글사인온이 수행될 때 Knowledge 기사 "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 Assertion 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>



 

 

Knowledge 기사 번호

001115955

 
로드 중
Salesforce Help | Article