none
Autodiscover blocked a potentially insecure redirection to ... RRS feed

  • Question

  • Hello.
    I have two custom sharepoint 2016 server jobs. Both of them using EWS for connecting to Excange mailbox. When both jobs running simultaneous on one application server (there are two application servers in  my farm), I have error only in one job «Autodiscover blocked a potentially insecure redirection to https://cas.domain.com/autodiscover/autodiscover.xml. To allow Autodiscover to follow the redirection, use the AutodiscoverUrl(string, AutodiscoverRedirectionUrlValidationCallback) overload.». I have this VB code in both of my applications:
    exchange = New ExchangeService(ExchangeVersion.Exchange2007_SP1)
    exchange.Credentials = New WebCredentials(account, password, domain)
    exchange.AutodiscoverUrl("account@domain.com")
    But, when both jobs running in different application servers there is no error.
    • Edited by ZaytsevVV Friday, September 14, 2018 7:02 AM
    Friday, September 14, 2018 7:02 AM

Answers

  • I replaced last string of my code by this:

    exchange.Url = New System.Uri("https://cas.domain.com/ews/exchange.asmx")

    and the issue was gone!

    • Marked as answer by ZaytsevVV Monday, September 17, 2018 8:37 AM
    Monday, September 17, 2018 8:37 AM