diff --git a/app/controllers/redmine_omniauth_controller.rb b/app/controllers/redmine_omniauth_controller.rb
index 3b8b71ababaf2897cc7d7c17217f82a3c5737e7e..7440eaa20543bb12d74f094a3f85a6f8da712748 100644
--- a/app/controllers/redmine_omniauth_controller.rb
+++ b/app/controllers/redmine_omniauth_controller.rb
@@ -16,9 +16,13 @@ class RedmineOmniauthController < AccountController
         # Self-registration off
         redirect_to(home_url) && return unless Setting.self_registration?
         # Create on the fly
-        user.login = info["email"].match(/(.+)@/)[1] unless info["email"].nil?
-        user.mail = info["email"] unless info["email"].nil?
         user.firstname, user.lastname = info["name"].split(' ') unless info['name'].nil?
+        user.firstname ||= info[:given_name]
+        user.lastname ||= info[:family_name]
+        user.mail = info["email"]
+        login = info["email"].match(/(.+)@/) unless info["email"].nil?
+        user.login = login[1] if login
+        user.login ||= [user.firstname, user.lastname]*"."
         user.random_password
         user.register
 
@@ -44,6 +48,9 @@ class RedmineOmniauthController < AccountController
           account_pending
         end
       end
+    else
+      flash[:error] = l(:notice_unable_to_obtain_google_credentials)
+      redirect_to signin_path
     end
   end
 
diff --git a/config/locales/en.yml b/config/locales/en.yml
index c55090a9552c8289da8acd66649bffe23666e83b..186006ccc670f130e5293816a5093a786818b9d0 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1,3 +1,3 @@
 # English strings go here for Rails i18n
 en:
-  my_label: "My label"
+  notice_unable_to_obtain_google_credentials: "Unable to obtain credentials from Google. You have not yet registered."
\ No newline at end of file