서명된 HMAC 토큰 생성
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
세그먼트 리디렉션 광고 모음 게재를 사용하여 만든 각 세그먼트 요청에는
사용하지 않는 경우 인증을 위한 HMAC 서명 토큰
초기 광고 시점 알림
이 토큰은 광고 시점당 한 번 계산되어 모든 스트림에 공유될 수 있습니다.
세션.
토큰 매개변수 수집
현재 광고 시점에서 다음 정보를 수집하여
토큰 본문입니다.
토큰 매개변수
|
custom_asset_key
|
필수
|
Google Ad Manager의 맞춤 라이브 스트림 애셋 키입니다.
|
cust_params
|
선택사항
|
맞춤 타겟팅 매개변수입니다. cust_params 를 참조하세요.
|
exp
|
필수
|
이 토큰의 만료 타임스탬프(초)입니다.
|
network_code
|
필수
|
이 네트워크의 Ad Manager 360 네트워크 코드입니다.
|
pod_id
|
필수
|
광고 시점의 식별자입니다. 다음에서 시작하는 정수여야 합니다.
1 하고 광고 시점마다 하나씩 증가합니다.
<ph type="x-smartling-placeholder"></ph>
이 값은 다음 기간 동안 동일한 광고 시점을 보는 모든 사용자에 대해 동일해야 합니다.
현재 이벤트를 나타냅니다.
|
pd
|
지속 시간이 없는 광고 시간이 사용 설정된 이벤트를 제외하고 필수입니다.
|
광고 시점의 길이(밀리초)입니다. 상기 명칭
ad_pod_duration
|
scte35
|
선택사항
|
Base64로 인코딩된 SCTE-35 신호입니다. 모든 Google Cloud 제품의
신호가 올바른지 확인합니다 올바르지 않으면
X-Ad-Manager-Dai-Warning HTTP 헤더의
신호가 계속 전파되어 광고 시점을 만듭니다. 자세한 내용은
광고 마커를 참고하세요.
|
토큰 문자열 만들기
각 매개변수를 name=value
형식으로 알파벳순으로 나열하세요.
물결표 (~
) 문자로 구분된 이름-값 쌍입니다.
값이 없는 선택적 매개변수는 빈 문자열을 사용하여 그대로 둘 수 있습니다.
완전히 제거되었습니다.
custom_asset_key={custom_asset_key}~exp={expiration}~network_code={network_code}~pd={pod_duration}~pod_id={ad_pod_index}~scte35={scte35_message}
HMAC 서명 생성
HMAC 서명은 16진수 형식의 토큰 문자열에 대한 SHA-256 해시입니다. 이
보안 비밀 키는
HMAC 인증 키
Google Ad Manager의 실시간 스트림 이벤트와
연결되어 있습니다
서명 토큰 문자열
생성된 후 다음 파일의 토큰 문자열에 HMAC 서명을 추가합니다.
형식
~hmac={HMAC signature}
URL 인코딩 토큰 문자열
이 토큰은 URL 매개변수로 전달되므로 안전을 위해 URL 인코딩해야 합니다.
예시 1
다음은 사용되지 않은 선택적 매개변수가 비어 있는 것으로 포함된 예입니다.
합니다.
토큰 문자열
custom_asset_key=iYdOkYZdQ1KFULXSN0Gi7g~cust_params=~exp=1489680000~network_code=6062~pd=180000~pod_id=5~scte35=
보안 비밀 키
A7490591290583E4B93189DEE7E287C299FC686872ABC7ADC9F9F536443505F
HMAC 서명
86d7e5f8c96fe4c83141d764df376ae14a0e2066f2e6b2ccfb9e1e2d3c869a88
서명된 토큰
custom_asset_key=iYdOkYZdQ1KFULXSN0Gi7g~cust_params=~exp=1489680000~network_code=6062~pd=180000~pod_id=5~scte35=~hmac=86d7e5f8c96fe4c83141d764df376ae14a0e2066f2e6b2ccfb9e1e2d3c869a88
URL로 인코딩된 서명된 토큰:
custom_asset_key%3DiYdOkYZdQ1KFULXSN0Gi7g~cust_params%3D~exp%3D1489680000~network_code%3D6062~pd%3D180000~pod_id%3D5~scte35%3D~hmac%3D86d7e5f8c96fe4c83141d764df376ae14a0e2066f2e6b2ccfb9e1e2d3c869a88
예 2
다음은 채워지지 않은 선택적 변수를 완전히 생략한 예입니다.
토큰 문자열
custom_asset_key=iYdOkYZdQ1KFULXSN0Gi7g3~exp=1489680000~network_code=6062~pd=180000~pod_id=5
보안 비밀 키
A7490591290583E4B93189DEE7E287C299FC686872ABC7ADC9F9F536443505F
HMAC 서명
6a8c44c72e4718ff63ad2284edf2a8b9e319600b430349d31195c99b505858c9
서명된 토큰
custom_asset_key=iYdOkYZdQ1KFULXSN0Gi7g~exp=1489680000~network_code=6062~pd=180000~pod_id=5~hmac=6a8c44c72e4718ff63ad2284edf2a8b9e319600b430349d31195c99b505858c9
URL로 인코딩된 서명된 토큰
custom_asset_key%3DiYdOkYZdQ1KFULXSN0Gi7g~exp%3D1489680000~network_code%3D6062~pd%3D180000~pod_id%3D5~hmac%3D6a8c44c72e4718ff63ad2284edf2a8b9e319600b430349d31195c99b505858c9
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-21(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-21(UTC)"],[[["\u003cp\u003eEach segment request using segment redirect pod serving requires an HMAC-signed token for authentication unless using early ad break notifications.\u003c/p\u003e\n"],["\u003cp\u003eThe token includes parameters like custom asset key, network code, pod ID, and duration, gathered from the ad break.\u003c/p\u003e\n"],["\u003cp\u003eAn HMAC signature is generated using a SHA-256 hash of the token string and a secret key from Google Ad Manager.\u003c/p\u003e\n"],["\u003cp\u003eThis signature is appended to the token string, which is then URL-encoded before being included in the segment request.\u003c/p\u003e\n"]]],[],null,["# Generate a signed HMAC token\n\nEach segment request made using segment redirect pod serving must include a\nHMAC-signed token for authentication, if not using\n[early ad break notifications](/ad-manager/video/Early.ad.break.notification).\n\nThis token can be calculated once per ad break and shared across all stream\nsessions.\n\nGather token parameters\n-----------------------\n\nGather the following information from the current ad break, to populate the\ntoken body.\n\n| Token Parameters |||\n|--------------------|------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `custom_asset_key` | Required | The custom livestream asset key, from Google Ad Manager. |\n| `cust_params` | Optional | Custom targeting parameters. See [cust_params](//support.google.com/admanager/answer/1080597). |\n| `exp` | Required | Expiration timestamp for this token in seconds. |\n| `network_code` | Required | The Ad Manager 360 network code for this network. |\n| `pod_id` | Required | Identifier for the ad break. Should be an integer starting at `1` and increasing by one for each ad break. **This value must be the same across all users viewing the same ad break in the current event.** |\n| `pd` | Required, except for events with durationless ad breaks enabled. | The duration in milliseconds of the ad break. Referred to above as `ad_pod_duration`. |\n| `scte35` | Optional | Base64-encoded SCTE-35 signal. It's the client's responsibility to ensure that the signal is correct. If incorrect, a message is sent to the `X-Ad-Manager-Dai-Warning` HTTP header in the response and the signal is still propagated to create an ad break. See the [supported ad markers](//support.google.com/admanager/answer/7245661#supported-ad-markers) for more information on how DAI uses the SCTE-35 signal. |\n\nCreate token string\n-------------------\n\nlist each parameter in alphabetical order, in the format `name=value`, with each\nname-value pair separated by a tilde (`~`) character.\n\nOptional parameters without a value can be left in-place with an empty string\nfor the value, or removed entirely.\n\n### token string format\n\n custom_asset_key={custom_asset_key}~exp={expiration}~network_code={network_code}~pd={pod_duration}~pod_id={ad_pod_index}~scte35={scte35_message}\n\nGenerate HMAC signature\n-----------------------\n\nThe HMAC signature is a SHA-256 hash of the token string in HEX format. The\nsecret key is the\n[HMAC authentication key](//support.google.com/admanager/answer/6381445)\nassociated with your livestream event in Google Ad Manager.\n\nSign token string\n-----------------\n\nOnce generated, append the HMAC signature to the token string in the following\nformat \n\n ~hmac={HMAC signature}\n\nURL-encode token string\n-----------------------\n\nThis token is passed as a URL parameter, so it must be URL-encoded for safety.\n\n### Example 1\n\nHere's an example where unused optional parameters are included as empty\nstrings.\n\n#### Token string\n\n custom_asset_key=iYdOkYZdQ1KFULXSN0Gi7g~cust_params=~exp=1489680000~network_code=6062~pd=180000~pod_id=5~scte35=\n\n#### Secret key\n\n A7490591290583E4B93189DEE7E287C299FC686872ABC7ADC9F9F536443505F\n\n#### HMAC signature\n\n 86d7e5f8c96fe4c83141d764df376ae14a0e2066f2e6b2ccfb9e1e2d3c869a88\n\n#### Signed token\n\n custom_asset_key=iYdOkYZdQ1KFULXSN0Gi7g~cust_params=~exp=1489680000~network_code=6062~pd=180000~pod_id=5~scte35=~hmac=86d7e5f8c96fe4c83141d764df376ae14a0e2066f2e6b2ccfb9e1e2d3c869a88\n\n#### URL-encoded signed token:\n\n custom_asset_key%3DiYdOkYZdQ1KFULXSN0Gi7g~cust_params%3D~exp%3D1489680000~network_code%3D6062~pd%3D180000~pod_id%3D5~scte35%3D~hmac%3D86d7e5f8c96fe4c83141d764df376ae14a0e2066f2e6b2ccfb9e1e2d3c869a88\n\n### Example 2\n\nHere's an example where the unpopulated optional variables are omitted entirely.\n\n#### Token string\n\n custom_asset_key=iYdOkYZdQ1KFULXSN0Gi7g3~exp=1489680000~network_code=6062~pd=180000~pod_id=5\n\n##### Secret key\n\n A7490591290583E4B93189DEE7E287C299FC686872ABC7ADC9F9F536443505F\n\n##### HMAC signature\n\n 6a8c44c72e4718ff63ad2284edf2a8b9e319600b430349d31195c99b505858c9\n\n#### Signed token\n\n custom_asset_key=iYdOkYZdQ1KFULXSN0Gi7g~exp=1489680000~network_code=6062~pd=180000~pod_id=5~hmac=6a8c44c72e4718ff63ad2284edf2a8b9e319600b430349d31195c99b505858c9\n\n#### URL-encoded signed token\n\n custom_asset_key%3DiYdOkYZdQ1KFULXSN0Gi7g~exp%3D1489680000~network_code%3D6062~pd%3D180000~pod_id%3D5~hmac%3D6a8c44c72e4718ff63ad2284edf2a8b9e319600b430349d31195c99b505858c9"]]