0
SIP 다이제스트 인증을 구현하는 중입니다. 여기 서버에서 내 401 응답이야. 그것이 내가 기대하는 것과 다른 값을 산출 몇 가지 이유를 들어SIP 다이제스트 인증에 대한 도움이 필요합니다.
def md5(user, realm, pass, method, String uri, nonce) {
def paramsDump = """md5() params
user: $user
realm: $realm
password: $pass
method: $method
uri: $uri
nonce: $nonce
"""
print paramsDump
def A1 = DigestUtils.md5Hex ("$user:$realm:$pass")
def A2 = DigestUtils.md5Hex ("$method:$uri")
def left = DigestUtils.md5Hex (A1)
def right = DigestUtils.md5Hex (A2)
DigestUtils.md5Hex ("$left:$nonce:$right")
}
md5 ('myuser',
'sip2sip.info',
'mypass',
'REGISTER',
'sip:sip2sip.info',
'4d417ba7bb1906c1434ba9645b35d5a84d0e71ad')
(그루비)과 같아야 응답을 소화 구성하는 RFC 2617 코드에 따라
SIP/2.0 401 Unauthorized
Call-ID: [email protected]:0:0:0:0:0:0:0
CSeq: 7 REGISTER
From: "myuser" <sip:[email protected]>;tag=c41616b8
To: "myuser" <sip:[email protected]>;tag=ac7e0189ab09b4fde10c77c8597b662a.5cbe
Via: SIP/2.0/UDP 172.22.162.100:5060;branch=z9hG4bK-333333-dd5444afbd4938fe01d9e1a47ccaf139
WWW-Authenticate: Digest realm="sip2sip.info", nonce="4d417ba7bb1906c1434ba9645b35d5a84d0e71ad"
Server: SIP Thor on OpenSIPS XS 1.4.5
Content-Length: 0
(I 미리 정의를 알고 내 계정에서 작동해야하는 값 - SIP Communicator 애플리케이션의 트래픽 스니핑을 수행했습니다. DigestUtils 유형은 Apache 코덱에서 유래합니다. 어떤 아이디어? 왼쪽과 오른쪽 그런를 만들 이유
감사합니다 - 당신은 그냥 내 일 – nixau
니스 저장 한! 도와 줘서 기뻐요! –
@ 도미니크 이것은 몇 년 후에 나도 알아하지만 내가 게시 한 비슷한 문제가 [여기] (http://stackoverflow.com/questions/36998787/asterisk-digest-authentication-for-sip-invite-gives-user -mismatch-error) 여러분이 살펴볼 수 있다면, 그것을 고맙게 생각할 것입니다. 나는 그것을 고치려고 많은 시간을 보냈지 만 아무 소용이 없다 ... – Sam