Media Vault
- 印刷する
- PDF
Media Vault
- 印刷する
- PDF
Article Summary
Share feedback
Thanks for sharing your feedback!
Classic/VPC環境で利用できます。
Media Vault
Query Based認証
認証に必要な tokenをクエリストリングに使用する認証方式を説明します。
URL Format
http://<published-url>?s=<start-time>&e=<end-time>&p=<length>&ip=<supported-IP-format>&h=<hash>
クエリストリングパラメータ
パラメータ タイプ 説明 s start-time 認証有効開始時間
(Unix epoch time)e end-time 認証有料終了時間
(Unix epoch time)p length hashに使用する URL prefixの長さ ip IP IPv4アドレス h hash MD5 hash
(h vパラメータを最後に使用
認証 URL作成例
- Secret: 認証作成のための Secret Key => navercloud
- start-time: 1669281713
- end-time: 1669282013 // +300秒
- 対象 URL: http://edge-auth.edge.naverncp.com/app/stream/playlist.m3u8
Full URL認証作成例
- Target URL: URLに認証条件(ipアドレスを含む)をクエリストリングで指定
- http://edge-auth.edge.naverncp.com/app/stream/playlist.m3u8?s=1669281713&e=1669282013&ip=192.168.200.0/24
- MD5作成: md5(secret key + target URL)
- md5(navercloudhttp://edge-auth.edge.naverncp.com/path-and-cookie/app/stream/playlist.m3u8?s=1669281713&e=1669282013&ip=192.168.200.0/24)
- => e35a703178d35420c89cd92b45e00287
- Secure URL: Target URLに md5値を hパラメータで追加
- http://edge-auth.edge.naverncp.com/app/stream/playlist.m3u8?s=1669281713&e=1669282013&ip=192.168.200.0/24&h=e35a703178d35420c89cd92b45e00287
Directory認証作成(for HLS)例
- Path URL: HLSサービスのために最後のディレクトリまで認証
- http://edge-auth.naverncp.com/app/stream/
- Path URLの lengthを求める
- p=39
- Target URL: Path URLに認証条件(ipアドレスを含む)をクエリストリングで指定
- http://edge-auth.naverncp.com/app/stream/?s=1669281713&e=1669282013&p=39&ip=192.168.200.0/24
- MD5の作成: md5(secretKey + target URL)
- md5(navercloudhttp://edge-auth.naverncp.com/app/stream/?s=1669281713&e=1669282013&p=39&ip=192.168.200.0/24)
- => 0b6c21513cf209d8168015e69ff13789
- Secure URL: Target URLに md5値を hパラメータで追加
- http://edge-auth.naverncp.com/app/stream/playlist.m3u8?s=1669281713&e=1669282013&p=39&ip=192.168.200.0/24&h=0b6c21513cf209d8168015e69ff13789
Path Based認証
認証に必要な tokenを URL Pathで使用する認証方式を説明します。
- path delim: パラメータ区切り文字、~ (デフォルト値)
- path token: トークン区切り文字、token= (デフォルト値)
- URL Format
http://<published-url-path>/token=s=<start-time>~e=<end-time>~p=<length>~ip=<supported-IP-format>~h=<hash>/<filename>
- Pathパラメータ
- Query Basedに使用するパラメータと同じ
Directory認証作成(for HLS)例
- Path URL: HLSサービスのために最後のディレクトリまで認証
- http://edge-auth.naverncp.com/app/stream/
- Path URLの lengthを求める
- p=39
- Target URL: Path URLに認証条件(ipアドレスを含む)をクエリストリングで指定
- http://edge-auth.naverncp.com/app/stream/?s=1669281713&e=1669282013&p=39&ip=192.168.200.0/24
- MD5の作成: md5(secretKey + target URL)
- md5(navercloudhttp://edge-auth.naverncp.com/app/stream/?s=1669281713&e=1669282013&p=39&ip=192.168.200.0/24)
- => 0b6c21513cf209d8168015e69ff13789
- Secure Token: token= 次に認証条件と md5値を使用
- token=s=1669281713&e=1669282013&p=39&ip=192.168.200.0/24&h=0b6c21513cf209d8168015e69ff13789
- &は~に置換
- /は%2Fに置換
- => token=s=1632727222~e=1632727522~p=39~ip=192.168.200.0%2F24~h=0b6c21513cf209d8168015e69ff13789
- Secure URL: Path URLに Secure Tokenを使用
- http://edge-auth.edge.naverncp.com/app/stream/token=s=1632727222~e=1632727522~p=39~ip=192.168.200.0/24~h=0b6c21513cf209d8168015e69ff13789/playlist.m3u8
この記事は役に立ちましたか?