Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ExHTTP provider and Negotiate authentication scheme support #107

Merged
merged 1 commit into from
Feb 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions autodiscover/autodiscover.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,40 @@ func GetRPCHTTP(email, autoURLPtr string, resp *utils.AutodiscoverResp) (*utils.
url := ""
user := ""
ntlmAuth := false
firstExHTTPResp := true

for _, v := range resp.Response.Account.Protocol {
if v.Type == "EXPR" {
if v.SSL == "Off" {
url = "http://" + v.Server
} else {
url = "https://" + v.Server
}
if v.AuthPackage == "Ntlm" { //set the encryption on if the server specifies NTLM auth
ntlmAuth = true
// use the first available Outlook provider and skip the others
if url == "" {
// ExHTTP (Exchange 2013+)
// the first ExHTTP answer is for internal Outlook clients
// and the second one is for external Outlook clients
// EXPR (Exchange 2007/2010) is for external Outlook clients
if v.Type == "EXHTTP" || v.Type == "EXPR" {
if v.Type == "EXHTTP" {
// skip the first answer
if firstExHTTPResp == true {
firstExHTTPResp = false
continue
}
}
if SessionConfig.Verbose == true {
utils.Trace.Printf("%s provider was selected", v.Type)
}
if v.SSL == "Off" {
url = "http://" + v.Server
} else {
url = "https://" + v.Server
}
if v.AuthPackage == "Ntlm" || v.AuthPackage == "Negotiate" { //set the encryption on if the server specifies NTLM or Negotiate auth
if SessionConfig.Verbose == true {
utils.Trace.Printf("Authentication scheme is %s", v.AuthPackage)
}
ntlmAuth = true
}
}
}
// EXCH (Exchange 2007/2010) is for internal Outlook clients
if v.Type == "EXCH" {
user = v.Server
}
Expand Down