twinslash / redmine_omniauth_google

This plugin is used to authenticate in redmine through Google.
http://www.redmine.org/plugins/redmine_omniauth_google
95 stars 103 forks source link

Fixed for Redmine 3.4 and Ruby 2.4 #43

Open EnziinSystem opened 6 years ago

EnziinSystem commented 6 years ago

This is the source final, it's work. Redmine 3.4 Ruby 2.4

redmine_omniauth_google.zip

kefahi commented 6 years ago

Thanks. That saved my day!

I just came across one issue in the parse_email function: a crash will result from improper access to the returned array. It seems that entries in a map like this x={:login=>"a", :domain=>"b"} can only be accessed via x[:domain] and not like this x["domain"] the later is the form that the code is using to refer to the map entries.

my fix was to change how the index is set in the returned map in lib/helpers/mail_helper.rb to {"login" => email_data[1], "domain" => email_data[2]} if email_data

My system specs :

  Redmine version                3.4.5.stable
  Ruby version                   2.4.3-p205 (2017-12-14) [x86_64-linux]
  Rails version                  4.2.8

Otherwise all worked well as expected. Thank you again! Regards,

kdevineni commented 6 years ago

Thanks kefahi fix worked for me. Without this fix, any entries in "Available domains" isn't working at all.

My Specs Environment: Redmine version 3.4.6.stable Ruby version 2.4.4-p296 (2018-03-28) [x86_64-linux] Rails version 4.2.8 Environment production Database adapter Mysql2

nam23690 commented 6 years ago

Hi all, My app error after redirect google. log in file is:

Started GET "/oauth2callback?code=4/WQCYaB41ZGi_zU3TqPwlol8N-CHhFfhqHiveQIr6ZZkWBe_gHAVYb0XGJ6HJ1JiNLPgfVy4nmM7Q6Jhm2ClgCBI&scope=https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile" for ::1 at 2018-09-13 19:52:14 +0700 Processing by RedmineOauthController#oauth_google_callback as HTML Parameters: {"code"=>"4/WQCYaB41ZGi_zU3TqPwlol8N-CHhFfhqHiveQIr6ZZkWBe_gHAVYb0XGJ6HJ1JiNLPgfVy4nmM7Q6Jhm2ClgCBI", "scope"=>"https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"} Current user: anonymous Completed 500 Internal Server Error in 81ms (ActiveRecord: 3.0ms)

Faraday::SSLError (SSL_connect returned=1 errno=0 state=error: certificate verify failed): plugins/redmine_omniauth_google/app/controllers/redmine_oauth_controller.rb:21:in oauth_google_callback' lib/redmine/sudo_mode.rb:63:insudo_mode' please help me, Thanks.