Skip to content

Commit 8f1b753

Browse files
Update README.md
1 parent 2baa356 commit 8f1b753

File tree

1 file changed

+47
-10
lines changed

1 file changed

+47
-10
lines changed

README.md

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,65 @@
11
# OmbuLabs::Auth
2-
Short description and motivation.
2+
> _Refactor a rack middleware (probably a ruby gem) out of https://points.ombulabs.com/ so that we can easily add GitHub-based authentication to other Ruby/Rails internal applications._
3+
>
4+
> _It would be useful if we could add it to http://skunk.fastruby.io (backend for skunk) so that anybody who is part of our organization could sign in and review details in the admin panel._
5+
>
6+
> _Said gem should be easily configurable (only with environment variables) and should make it very simple to add "OmbuLabs-authentication" to our internal Ruby apps._
37
4-
## Usage
5-
How to use my plugin.
8+
## Configs
9+
Make sure you configure your ENV variables to use Github authentication.
610

11+
```
12+
ENV["GITHUB_APP_ID"]
13+
ENV["GITHUB_APP_SECRET"]
14+
ENV["ORGANIZATION_LOGIN"]
15+
```
716
## Installation
8-
Add this line to your application's Gemfile:
17+
18+
- Clone this gem inside the `lib` folder of your project
19+
20+
21+
- Add these lines to your application's Gemfile:
922

1023
```ruby
11-
gem "ombu_labs-auth"
24+
gem 'ombu_labs-auth', path: 'lib/ombu_labs-auth'
25+
gem 'omniauth-github', '~> 2.0.0'
1226
```
1327

14-
And then execute:
28+
- And then execute:
1529
```bash
1630
$ bundle
1731
```
1832

19-
Or install it yourself as:
20-
```bash
21-
$ gem install ombu_labs-auth
33+
- Add the following line to `config/routes.rb`
34+
35+
```ruby
36+
mount OmbuLabs::Auth::Engine, at: '/', as: 'ombu_labs_auth'
37+
```
38+
39+
- Add a Devise signin link in your homepage (notice all URL helpers will be under the engine object `ombu_labs_auth`)
40+
41+
```html
42+
<div>
43+
<h1>Welcome to the App</h1>
44+
<%= link_to "Sign in", ombu_labs_auth.new_user_session_path %>
45+
</div>
46+
```
47+
48+
- Add the Devise authentication helper to your private objects controllers
49+
2250
```
51+
before_action :authenticate_user!
52+
```
53+
54+
## Usage
55+
_TODO_
56+
57+
## Caveats
58+
59+
Please be aware this gem is a mountable engine which depends on Devise, and it's not possible to mount it multiple times. Refer to their Wiki for more on the issue - https://github.com/heartcombo/devise/wiki/How-To:-Use-devise-inside-a-mountable-engine
2360

2461
## Contributing
25-
Contribution directions go here.
62+
_TODO_
2663

2764
## License
2865
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

0 commit comments

Comments
 (0)