我正尝试将响应发送回请求摘要访问身份验证的服务器]
。创建.... FResponseHeader.Text := FResponseText;// received header. FResponseHeader.ProcessHeaders; .... WriteLn(FResponseHeader.WWWAuthenticate); //WWW-Authenticate: Digest realm="xxxx.com", nonce="fq1uvocyzvr17e6a5syproazd5phwdvhvlc5", stale=false, algorithm=MD5, qop="auth" LIdAuthentication := TIdDigestAuthentication.Create; try LIdAuthentication.Username := FUser; LIdAuthentication.Password := FPass; LIdAuthentication.Uri := FURI; LIdAuthentication.Method := GetMsgTypeString(FResponseHeader.RequestMethods); LIdAuthentication.Params.Values['Authorization'] := FResponseHeader.WWWAuthenticate; LIdAuthentication.AuthParams.AddValue('Digest', FResponseHeader.WWWAuthenticate); for I := 0 to LIdAuthentication.Steps do LIdAuthentication.Next; Result := LIdAuthentication.Authentication; finally LIdAuthentication.Free; end;
我从服务器获得了[[401
Authorization Header
的正确方法是什么?我正在尝试将响应发送回请求摘要访问身份验证的服务器...。FResponseHeader.Text:= FResponseText; //收到的标头。 FResponseHeader.ProcessHeaders; .... ...TIdDigestAuthentication
(和其他TIdAuthentication
派生的类)旨在与TIdHTTP
一起使用,而不是独立使用。