NTLM test case fixes for SSPI order change.
This commit is contained in:
parent
780f771070
commit
f3539be58e
@ -42,7 +42,7 @@ func TestNtlmAuth(t *testing.T) {
|
||||
case 1:
|
||||
w.Header().Set("Www-Authenticate", "ntlm")
|
||||
w.WriteHeader(401)
|
||||
case 2:
|
||||
case 2, 4:
|
||||
assert.True(t, strings.HasPrefix(req.Header.Get("Authorization"), "NTLM "))
|
||||
neg := authHeader[5:] // strip "ntlm " prefix
|
||||
_, err := base64.StdEncoding.DecodeString(neg)
|
||||
@ -80,6 +80,12 @@ func TestNtlmAuth(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
if called == 3 {
|
||||
// This is the SSPI call that should return unauth so that standard NTLM can run.
|
||||
w.WriteHeader(401)
|
||||
return
|
||||
}
|
||||
|
||||
err = session.ProcessAuthenticateMessage(authMsg)
|
||||
if !assert.Nil(t, err) {
|
||||
t.Logf("auth process error: %+v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user