You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basic authentication is deprecated, and being removed from Exchange Online 13th October. This means that anything using Viewpoint against O365 will fail on that date.
I reported this issue as a user, I have no idea what the maintainer(s) is doing about it. 🤷♂️ My employer dropped our inhouse exchange integration in favour of one written externally, so it's not my problem anymore.
Call load_viewpoint_class (where needed) to monkey-patch Viewpoint gem to support OAuth:
defload_viewpoint_classreturnifdefined?(Viewpoint::EWS::Connection)require'viewpoint'Viewpoint::EWS::Connection.class_evaldodefinitialize(auth,opts={})@log=Logging.logger[self.class.name.to_s.to_sym]@httpcli=http_object(opts)@auth_type=auth[:type]@auth_token=@auth_type == 'oauth' ? auth[:token] : nil@endpoint=auth[:endpoint]enddefpost(xmldoc)headers={'Content-Type'=>'text/xml'}if@auth_type == 'oauth' && @auth_token.present?headers=headers.merge({'Authorization'=>"Bearer #{@auth_token}"})endcheck_response(@httpcli.post(@endpoint,xmldoc,headers))endprivatedefhttp_object(opts)@httpcli=ifopts[:user_agent]HTTPClient.new(agent_name: opts[:user_agent])elseHTTPClient.newendtrust_ca_option(opts)ssl_config(opts)timeout_options(opts)@httpclienddeftrust_ca_option(opts)returnifopts[:trust_ca].nil?@httpcli.ssl_config.clear_cert_storeopts[:trust_ca].eachdo |ca|
@httpcli.ssl_config.add_trust_cacaendenddefssl_config(opts)@httpcli.ssl_config.verify_mode=opts[:ssl_verify_mode]ifopts[:ssl_verify_mode]@httpcli.ssl_config.ssl_version=opts[:ssl_version]ifopts[:ssl_version]enddeftimeout_options(opts)# Up the keep-alive so we don't have to do the NTLM dance as often.@httpcli.keep_alive_timeout=60@httpcli.receive_timeout=opts[:receive_timeout]ifopts[:receive_timeout]@httpcli.connect_timeout=opts[:connect_timeout]ifopts[:connect_timeout]endendViewpoint::EWSClient.class_evaldodefinitialize(auth,opts={})auth=auth.dup@auth_type=auth[:type]@auth_token=@auth_type == 'oauth' ? auth[:token] : nil@endpoint=auth[:endpoint]@username=auth[:user]password=@auth_type == 'basic' ? auth[:password] : nilhttp_klass=opts[:http_class] || Viewpoint::EWS::Connectionconnection=http_klass.new(auth,opts[:http_opts] || {})connection.set_auth(@username,password)ifpassword.present?@ews=Viewpoint::EWS::SOAP::ExchangeWebService.new(connection,opts)endendend
Hi - I recently took over maintenance for a few gems in this org. @fliebe92 I tried to integrate your suggested fix into main...oauth - do I have your permission to merge your contribution into main and make a release?
Hi - I recently took over maintenance for a few gems in this org. @fliebe92 I tried to integrate your suggested fix into main...oauth - do I have your permission to merge your contribution into main and make a release?
Hi @pcai. Feel free to merge it and make a release. Thanks! :)
Activity
fliebe92 commentedon Dec 6, 2022
Hey @fuzzy76, do you have any news about this issue?
Thanks for your collaboration 😄
fuzzy76 commentedon Dec 7, 2022
I reported this issue as a user, I have no idea what the maintainer(s) is doing about it. 🤷♂️ My employer dropped our inhouse exchange integration in favour of one written externally, so it's not my problem anymore.
fliebe92 commentedon Dec 7, 2022
Thanks for the quick reply @fuzzy76 👍
@zenchild, any news about this issue, or could we consider this repository as stale/unmaintained?
fliebe92 commentedon Dec 16, 2022
Hey folks 👋 ,
we invested some time to get this working and we would like to share it with the Ruby community, here you go 🚀 :
Usage with OAuth:
Usage with Basic Auth:
Call
load_viewpoint_class(where needed) to monkey-patch Viewpoint gem to support OAuth:pcai commentedon Jul 8, 2024
Hi - I recently took over maintenance for a few gems in this org. @fliebe92 I tried to integrate your suggested fix into main...oauth - do I have your permission to merge your contribution into main and make a release?
fliebe92 commentedon Jul 9, 2024
Hi @pcai. Feel free to merge it and make a release. Thanks! :)
pcai commentedon Nov 7, 2026
Closing, this was fixed in #305