go_sso 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -0
- data/app/controllers/go_sso/application_controller.rb +0 -4
- data/lib/go_sso/controllers/helpers.rb +4 -0
- data/lib/go_sso/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 141663866cb0c76ce7d600625d230153c747493dd4814ad5dd3a79e7d8cd8846
|
4
|
+
data.tar.gz: 686176927a42cd377a4dc38bc9eca2125c812b70366b695603187365a58bc2ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92ebdb0a8e6ad0a81de62f66c15cd6891b1dc836a88203a1c3c251de604e3499a249f160b74937c0d3d6782144b15bfe5dd066d76cf15e93f49d982a2343a800
|
7
|
+
data.tar.gz: c42f320ed2432412fe15ac7415f7b8d52f82a5f4a417d78ff76c6f6d3c5d2191b3d5e8edc88eb3fcb7f2147635cd14fef9abc8e2b15aa526a3ecbea126125bea
|
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# GoSSO
|
2
|
+
|
3
|
+
This is a plugin to protect applications from access by unauthorized users.
|
4
|
+
You need to have your own OAuth server as SSO(Single Sign On) server
|
5
|
+
then install this plugin to each application need to be protected.
|
6
|
+
|
7
|
+
Set the SSO server secrets through environment variables:
|
8
|
+
```
|
9
|
+
GO_SSO_CLIENT_ID=
|
10
|
+
GO_SSO_CLIENT_SECRET=
|
11
|
+
GO_SSO_CLIENT_SITE=
|
12
|
+
```
|
13
|
+
|
14
|
+
Create a initializer file for other configurations:
|
15
|
+
|
16
|
+
```
|
17
|
+
GoSso.setup do |config|
|
18
|
+
config.client_id # GO_SSO_CLIENT_ID
|
19
|
+
config.client_secret # GO_SSO_CLIENT_SECRET
|
20
|
+
config.site # GO_SSO_CLIENT_SITE
|
21
|
+
config.user_json_url # default: 'api/me'
|
22
|
+
config.user_cache_ttl # default 1.minute
|
23
|
+
config.main_app_module_name # default is your host app module name
|
24
|
+
config.host # set to your app host
|
25
|
+
end
|
26
|
+
```
|
27
|
+
|
28
|
+
You must implement `api/me` to response user information in JSON format which provides `applications` attribute at least.
|
29
|
+
`applications` is an array of strings.
|
30
|
+
|
31
|
+
Add `before :authenticate_sso_user_permission` to application controllers.
|
32
|
+
Pages with this hook will be protected.
|
33
|
+
If `current_sso_user` is not present, redirect users to SSO to login.
|
34
|
+
Users can access the protected page only if after login and their applications attribute contains `main_app_module_name`
|
35
|
+
|
36
|
+
You can access current user in views or controllers via `current_sso_user`.
|
data/lib/go_sso/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: go_sso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yi Feng
|
@@ -116,6 +116,7 @@ extensions: []
|
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
118
|
- MIT-LICENSE
|
119
|
+
- README.md
|
119
120
|
- Rakefile
|
120
121
|
- app/assets/config/go_sso_manifest.js
|
121
122
|
- app/assets/stylesheets/go_sso/application.css
|