Oleg,
Ok, I think I solved it. This line:
NTCredentials ntCredentials = new NTCredentials(_user, _password,
localIp, _domain);
Changed to
NTCredentials ntCredentials = new NTCredentials(_mailbox, _password,
localIp, "");
Seemed to do the trick! Thanks for your attention.
-----Original Message-----
From: Oleg Kalnichevski [mailto:[email protected]]
Sent: Tuesday, December 04, 2018 12:02 PM
To: HttpClient User Discussion
Subject: Re: Authenticate in Microsoft Cloud, O365
On Tue, 2018-12-04 at 16:20 +0000, David J. Godbey (HQ-LM020)[DIGITAL
MANAGEMENT INC.] wrote:
> Oleg,
> NASA is moving out of the email hosting business, and they are moving
> the email enterprise into the Microsoft cloud hosted (O365 they call
> it) environment.
>
Please produce a complete context / wire log of the session. Please be sure to
redact any details you deem sensitive. I do not want to be accused of hacking
NASA, rigging elections or stealing Christmas.
http://hc.apache.org/httpcomponents-client-4.5.x/logging.html
Oleg
> One of the engineers is telling me: "on-premises is very forgiving and
> will allow you to use domain\username. When you go to the cloud, we
> can only use the UPN [email protected]."
>
> Currently I setup my client authenticator as follows, where "on-
> premises" works fine, but cloud does not:
> String localIp = Inet4Address.getLocalHost().getHostAddress();
> CloseableHttpClient httpclient = null;
> HttpHost httpHost = new HttpHost(_host, 443, "https");
> NTCredentials ntCredentials = new NTCredentials(_user,
> _password, localIp, _domain);
> AuthScope authScope = new AuthScope(httpHost);
> CredentialsProvider credsProvider = new
> BasicCredentialsProvider();
> credsProvider.setCredentials(authScope, ntCredentials);
> httpclient =
> HttpClients.custom().setDefaultCredentialsProvider(credsProvider).bui
> ld();
>
> _httpclient = httpclient;
> _httpHost = httpHost;
>
> The working document:
> https://docs.microsoft.com/en-us/exchange/client-developer/exchange-se
> rver-development
>
> I'll continue looking around. Do you have any advice in the interim?
> Thanks,
> Dave
>
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:[email protected]]
> Sent: Tuesday, December 04, 2018 10:41 AM
> To: HttpClient User Discussion
> Subject: Re: Authenticate in Microsoft Cloud, O365
>
> On Tue, 2018-12-04 at 14:03 +0000, David J. Godbey (HQ-LM020)[DIGITAL
> MANAGEMENT INC.] wrote:
> > Folks:
> > I did a quick search of the site, but I see no discussion of this.
> > Let me ask here, does httpclient know how to authenticate to the
> > Microsoft Cloud?
> > Thanks!
> >
> > Dave Godbey
> > Email: [email protected]<mailto:[email protected]>
> > Phone: 410 569-5546
> >
>
> What is Microsoft? I vaguely remember a US company that used to
> produce decent Linux appliances called X-Box.
>
> What is Microsoft Cloud exactly? What authentication schemes does it
> support?
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]