authentication - RTSP 身份验证 : digest issue

标签 authentication streaming rtsp http-authentication digest-authentication

我需要向流媒体服务器验证我的 RTSP 流,这是挑战:

RTSP/1.0 401 Unauthorized
WWW-Authenticate: Digest realm="Streaming Server",  nonce="76bfe6986d3e766424de9bd6e7d3ccc1"
Session: 1845562184;timeout=60
Cseq: 1
...

Wirecast 设法使用这些设置成功进行身份验证:
Host name : 192.168.33.9:1935/live/my_stream.sdp
location : live/my_stream.sdp
username : user
password : test

它的响应是:e1dff363b9763df0c7615429af79715c

所以根据wikipedia我尝试使用以下方法进行身份验证:
//H(data) = MD5(data)
//KD(secret, data) = H(secret:data)
//A1 = username:realm:password
//A2 = http-method:uri
//response = KD( H(A1), nonce:H(A2))

HA1 = md5("user:Streaming Server:test")
HA2 = md5("POST:live/my_stream.sdp")
RESPONSE = md5(HA1+":"+nonce+":"+HA2)

但是使用此代码,我得到响应“0963c3a7b1481523f809e6affa7e792e”和 401 Unauthorized

你能帮助我吗 ?

最佳答案

响应的计算应该是:

HA1 = md5("user:Streaming Server:test")
HA2 = md5("DESCRIBE:/live/my_stream.sdp")
RESPONSE = md5(HA1+":"+nonce+":"+HA2)

以及完整的身份验证字符串:
Authorization: Digest
username="user",
algorithm="MD5",
realm="Streaming Server",
nonce="76bfe6986d3e766424de9bd6e7d3ccc1",
uri="/live/my_stream.sdp",
response="de73283590f7ad76929d20f0d06e914b"

关于authentication - RTSP 身份验证 : digest issue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17444635/

相关文章:

OpenGL。使用 glBufferData 更新顶点缓冲区

tcp - ffmpeg 编码力 rtsp 输出流使用 TCP 作为 rtsp_transport

php - 为 Android 构建一个简单的音乐流应用程序

android - 通过Android设备RTSP Android从IPcamera实时流式传输到wowza服务器

javascript - JS API 认证

cakephp - acos 表中使用的 model、lft 和 rght 字段是什么?

node.js - 如何使用 Node.js 通过 ffmpeg 流式传输 MP4 文件?

audio - 查找带有 HTML5 <audio> 标签的流式 MP3 文件

wcf - 安全的 WCF 服务,除了 SSL 协议(protocol)之外还需要什么样的身份验证?

azure - 无效授予(错误代码 70000)刷新 token Azure AD