Update outdated google icon, add new one for heroku

Add/update icons for default supported providers. Update README and
license file as well.
pull/6827/head
Yury Buldakov 8 years ago
parent 5e96a17659
commit c2c8654b62
  1. 41
      README.md
  2. 5
      app/assets/images/openid_connect/LICENSE
  3. 3
      app/assets/images/openid_connect/LICENSE.md
  4. BIN
      app/assets/images/openid_connect/auth_provider-google.png
  5. BIN
      app/assets/images/openid_connect/auth_provider-heroku.png

@ -4,31 +4,33 @@ Adds support for OmniAuth OpenID Connect strategy providers, most importantly Go
## Dependencies ## Dependencies
You will have to add the following lines to your OpenProject's _Gemfile.plugins_ for the time being (omit aleady existing ones): You will have to add the following lines to your OpenProject's `Gemfile.plugins` for the time being (omit aleady existing ones):
```ruby
gem "openproject-auth_plugins", :git => 'git@github.com:finnlabs/openproject-auth_plugins', :branch => 'dev' gem "openproject-auth_plugins", :git => 'git@github.com:finnlabs/openproject-auth_plugins', :branch => 'dev'
gem 'omniauth-openid-connect', :git => 'git@github.com:finnlabs/omniauth-openid-connect.git', :branch => 'dev' gem 'omniauth-openid-connect', :git => 'git@github.com:finnlabs/omniauth-openid-connect.git', :branch => 'dev'
gem 'omniauth-openid_connect-providers', :git => 'git@github.com:finnlabs/omniauth-openid_connect-providers.git', :branch => 'dev' gem 'omniauth-openid_connect-providers', :git => 'git@github.com:finnlabs/omniauth-openid_connect-providers.git', :branch => 'dev'
gem 'openproject-openid_connect', :git => 'git@github.com:finnlabs/openproject-openid_connect.git', :branch => 'dev' gem 'openproject-openid_connect', :git => 'git@github.com:finnlabs/openproject-openid_connect.git', :branch => 'dev'
gem 'lobby_boy', :git => 'git@github.com:finnlabs/lobby_boy.git', :branch => 'dev' gem 'lobby_boy', :git => 'git@github.com:finnlabs/lobby_boy.git', :branch => 'dev'
```
### Development ### Development
If you want to run the tests you will have add the following as well: If you want to run the tests you will have add the following as well:
```ruby
group :test do group :test do
gem 'rspec-steps', '~> 0.4.0' gem 'rspec-steps', '~> 0.4.0'
end end
```
## Configuration ## Configuration
The provider configuration can be either done in `configuration.yml` or within the settings. The provider configuration can be either done in `configuration.yml` or within the settings.
### configuration.yml ### `configuration.yml`
Example configuration: Example configuration:
```yaml
default: default:
openid_connect: openid_connect:
google: google:
@ -36,11 +38,26 @@ Example configuration:
secret: "4z389thugh334t8h" secret: "4z389thugh334t8h"
icon: "openid_connect/auth_provider-google.png" icon: "openid_connect/auth_provider-google.png"
display_name: "Google" display_name: "Google"
```
The last two attributes are commonly available for all providers. They are used to change a provider's look.
To grab corresponding values from ENV (eg. on heroku) do it this way:
```yaml
default:
...
openid_connect:
google:
identifier: <%= ENV['GOGLE_CLIENT_ID'] %>
secret: <%= ENV['GOOGLE_CLIENT_SECRET'] %>
...
```
Note that currently there are only two custom provider icons this plugin has out of the box (for supported providers):
The last two attributes are commonly available for all providers. * `openid_connect/auth_provider-google.png`
They are used to change a provider's look. * `openid_connect/auth_provider-heroku.png`
Note that `openid_connect/auth_provider-google.png` is the one custom provider icon this plugin has out of the box. Other icons you will have to add yourself. Other icons you will have to add yourself. <small>FIXME: Elaborate on this a bit as it is unclear
how and where they should be added</small>
`display_name` changes a provider's label shown to the user. `display_name` changes a provider's label shown to the user.
@ -61,7 +78,7 @@ check_session_iframe: '/auth/check_session'
### Settings ### Settings
There is no UI for the settings just yet. One way to set them until then is the rails console: There is no UI for the settings just yet. One way to set them until then is the rails console:
```ruby
Setting["plugin_openproject_openid_connect"] = { Setting["plugin_openproject_openid_connect"] = {
"providers" => { "providers" => {
"google" => { "google" => {
@ -74,10 +91,11 @@ There is no UI for the settings just yet. One way to set them until then is the
} }
} }
} }
```
While Google and Heroku are pre-defined you can add arbitrary providers through configuration. While Google and Heroku are pre-defined you can add arbitrary providers through configuration.
Those may then require the host and/or endpoints to be specified depending on whether or not a particular provider adheres to the default endpoint paths. Those may then require the host and/or endpoints to be specified depending on whether or not a particular provider adheres to the default endpoint paths.
```ruby
Setting["plugin_openproject_openid_connect"] = { Setting["plugin_openproject_openid_connect"] = {
"providers" => { "providers" => {
"myprovider" => { "myprovider" => {
@ -102,6 +120,7 @@ Those may then require the host and/or endpoints to be specified depending on wh
} }
} }
} }
```
If a host is given, relative endpoint paths will refer to said host. If a host is given, relative endpoint paths will refer to said host.
No host is required if absolute endpoint URIs are given. No host is required if absolute endpoint URIs are given.
@ -128,4 +147,4 @@ If you want to use a different list of CAs for validating provider SSL certifica
## Credits ## Credits
This plugin uses some of Neil Hainsworth' [Free Social Icons](http://www.neilorangepeel.com/free-social-icons/). This plugin uses some of [Social Icons](https://github.com/yukoff/social-icons).

@ -1,5 +0,0 @@
Free Social Icons from Neil Hainsworth
"Feel free to use them however you'd like :)"
http://www.neilorangepeel.com/free-social-icons/

@ -0,0 +1,3 @@
# License
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">Social Icons</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="https://github.com/yukoff/social-icons" property="cc:attributionName" rel="cc:attributionURL">yukoff</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Loading…
Cancel
Save