This plugin is used to authenticate Redmine users using Google's OpenId Connect provider.
Download the plugin and install required gems:
cd /path/to/redmine/plugins
git clone https://github.com/tasogarei/redmine_omniauth_google.git
cd /path/to/redmine
bundle install
Restart the app
touch /path/to/redmine/tmp/restart.txt
To authenticate via Google you must first register your redmine instance via the Google Cloud Console
- Go to the registration link.
- Click your Project's name
- Click "APIs & Services" -> "Credentials"
- Click "Create credentials" -> "OAuth ClientId"
- Select "Web Application" as the Platform
- Type a Name for the application, e.g. "My Redmine"
- Type a Authorized redirect URIs for the callback url("https://mydomain.com/redmine/oauth2callback"), where "mydomain.com/redmine" is the domain / path for your redmine instance. *** The plugin will not work without this setting ***
- Click "Create"
- Save the Client ID and Client Secret for the configuration of the Redmine plugin (see below)
- Login as a user with administrative privileges.
- In top menu select "Administration".
- Click "Plugins"
- In plugins list, click "Configure" in the row for "Redmine Omniauth Google plugin"
- Enter the Сlient ID & Client Secret shown when you registered your application via Google Cloud Console.
- Check the box near "Oauth authentication"
- Click Apply.
Users can now to use their Google Account to log in to your instance of Redmine.
Additionaly
- Setup value Autologin in Settings on tab Authentification
By default, all user email domains are allowed to authenticate through Google. If you want to limit the user email domains allowed to use the plugin, list one per line in the "Allowed domains" text box.
For example:
onedomain.com
otherdomain.com
With the above configuration, only users with email addresses on the domains "onedomain.com" and "otherdomain.com" will be allowed to acccess your Redmine instance using Google OAuth.
- An unauthenticated user requests the URL to your Redmine instance.
- User clicks the "Login via Google" buton.
- The plugin redirects them to a Google sign in page if they are not already signed in to their Google account.
- Google redirects user back to Redmine, where the Google OAuth plugin's controller takes over.
One of the following cases will occur:
- If self-registration is enabled (Under Administration > Settings > Authentication), user is redirected to 'my/page'
- Otherwse, the an account is created for the user (referencing their Google OAuth2 ID). A Redmine administrator must activate the account for it to work.
3.3.2 3.4.3
If the Google's icon does not meet Redmine's theme, you can change it.
Default icon is btn_google_signin_dark_normal_web.png
.
Change File : /app/views/hooks/_view_account_login_bottom.html.erb
<%= stylesheet_link_tag 'buttons', :plugin => 'redmine_omniauth_google' %>
<% if Setting.plugin_redmine_omniauth_google['oauth_authentification'] %>
<%= link_to oauth_google_path(:back_url => back_url) do %>
<%= button_tag :class => 'button-login' do %>
<%= image_tag('/plugin_assets/redmine_omniauth_google/images/btn_google_signin_dark_normal_web.png', :class => 'button-login-icon', :alt => l(:login_via_google)) %>
<% end %>
<% end %>
<% end %>
<%= stylesheet_link_tag 'buttons', :plugin => 'redmine_omniauth_google' %>
<% if Setting.plugin_redmine_omniauth_google['oauth_authentification'] %>
<%= link_to oauth_google_path(:back_url => back_url) do %>
<%= button_tag :class => 'button-login' do %>
<%= image_tag('/plugin_assets/redmine_omniauth_google/images/btn_google_signin_light_normal_web.png', :class => 'button-login-icon', :alt => l(:login_via_google)) %>
<% end %>
<% end %>
<% end %>