Project

Profile

Help

How to connect?
Download (1.88 KB) Statistics
| Branch: | Revision:

root / README.md @ master

1
# OAuth 2 OmniAuth strategy for Redmine
2

    
3
Allows client applications to access Redmine resources. For now, you will need
4
to apply [this patch](https://www.redmine.org/issues/24808).
5

    
6
## Usage
7

    
8
Add the Gem to your Gemfile. Exact usage depends on your environment, here are
9
some examples:
10

    
11
### Rails, plain OmniAuth
12

    
13
In an initializer, do
14

    
15
~~~ruby
16
Rails.application.config.middleware.use OmniAuth::Builder do
17
  provider :redmine_oauth2,
18
    ENV['REDMINE_APP_ID'],
19
    ENV['REDMINE_APP_SECRET'],
20
    client_options: { site: 'https://redmine.yourcompany.com' },
21
    scope: 'view_issues'
22
end
23
~~~
24

    
25
### Rails, with Devise
26

    
27
~~~ruby
28
Devise.setup do |config|
29
  config.omniauth :redmine_oauth2,
30
    ENV['REDMINE_APP_ID'],
31
    ENV['REDMINE_APP_SECRET'],
32
    client_options: { site: 'https://redmine.yourcompany.com' },
33
    scope: 'view_issues'
34
end
35
~~~
36

    
37

    
38

    
39
## License
40

    
41
Copyright (c) 2020 by Jens Kraemer, Planio GmbH
42

    
43
Permission is hereby granted, free of charge, to any person obtaining a copy of
44
this software and associated documentation files (the "Software"), to deal in
45
the Software without restriction, including without limitation the rights to
46
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
47
of the Software, and to permit persons to whom the Software is furnished to do
48
so, subject to the following conditions:
49

    
50
The above copyright notice and this permission notice shall be included in all
51
copies or substantial portions of the Software.
52

    
53
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
54
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
55
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
56
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
57
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
58
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
59
SOFTWARE.
(3-3/5)