winrb / autodiscover Goto Github PK
View Code? Open in Web Editor NEWRuby client for Microsoft's Autodiscover Service
License: MIT License
Ruby client for Microsoft's Autodiscover Service
License: MIT License
I realize this is a very new gem. Thanks for your work!
I've been spiking recently on integrating Viewpoint into my app and I recently decided I'd like to integrate use of Exchange's Autodiscovery so my user's wouldn't need to know their EWS endpoints.
That being said, I experienced the following while playing with this gem:
client = Autodiscover::Client.new(email: user.email, password: user.password)
#=> #<Autodiscover::Client:0x007ff4c8413768 ...<details snipped>...>
data = client.autodiscover
#=> OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
# from /Code/ews_poc/vendor/bundle/gems/httpclient-2.6.0.1/lib/httpclient/session.rb:307:in `connect'
I haven't had to deal with server certificates at all while playing with your `WinRb/Viewpoint' gem, so I thought this might be a "new gem; version 0.1.0; all-of-the-things don't work yet!" kinda thing.
On a whim, I did the following:
pox_request = Autodiscover::PoxRequest.new(client)
# => #<Autodiscover::PoxRequest:0x007ff4c4af9b80 ...<details snipped>...>
pox_request.send(:request_body)
#=> "<?xml version=\"1.0\"?>\n<Autodiscover xmlns=\"http://schemas.microsoft.com/exchange/autodiscover/outlook/requestschema/2006\">\n <Request>\n <EMailAddress>[email protected]</EMailAddress>\n <AcceptableResponseSchema>http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a</AcceptableResponseSchema>\n </Request>\n</Autodiscover>\n"
pox_request.send(:available_urls).to_a
#=> ["https://advisory.com/autodiscover/autodiscover.xml", "https://autodiscover.advisory.com/autodiscover/autodiscover.xml", nil]
pox_request.instance_variable_get(:@formatted_urls)
#=> ["https://users_domain.com/autodiscover/autodiscover.xml", "https://autodiscover.users_domain.com/autodiscover/autodiscover.xml"]
pox_request.instance_variable_get(:@formatted_urls).each { |url| url.gsub!(/https/, 'http') }
=> ["http://users_domain.com/autodiscover/autodiscover.xml", "http://autodiscover.users_domain.com/autodiscover/autodiscover.xml"]
response = pox_request.autodiscover
#=> #<Autodiscover::PoxResponse:0x007ff4caaca488 ...<details snipped>...>
response.ews_url
#=> "https://mail.users_domain.com/ews/exchange.asmx"
Should I expect that I need to deal with server certificates? Is the gem supposed to handle this sort of thing but it just isn't handled yet?
Client#autodiscover
hangs when credentials are invalid.
The autodiscover page re-prompts the user for credentials when bad credentials are supplied.
Example: https://autodiscover.microsoft.com/autodiscover/autodiscover.xml
With this script:
require 'autodiscover'
client = Autodiscover::Client.new(email: "[email protected]", password: "XXXXXXXX")
data = client.autodiscover(ignore_ssl_errors: true)
puts data.response
I'm getting back nil
for the autodiscover call. I have to do the ignore, as the certificate doesn't match the domain (the exchange admins say that there's no problem, but eM Client complains about this too).
Hi there. There is no proper error handling in when checking the redirected_http_url.
To test this just take a domain with an invalid/self signed SSL certificate like e.g. [email protected]
Exchange emails for an Office 365 setup with no custom domain are of the format [email protected]
. The gem incorrectly tries to find the autodiscovery URL at domain-name.onmicrosoft.com
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.