pixnet-sso 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -9,7 +9,7 @@ by Manic <http://tech.manic.tw>
9
9
 
10
10
  ## DESCRIPTION:
11
11
 
12
- Clients for PIXNET SSO
12
+ Clients for PIXNET SSO, Rails Gem
13
13
 
14
14
  ## INSTALLATION:
15
15
 
@@ -17,24 +17,11 @@ Clients for PIXNET SSO
17
17
 
18
18
  ## ENABLE PIXNET SSO:
19
19
 
20
- ### CONFIG:
20
+ ### GENERATE CONFIG/MODEL:
21
21
 
22
- Create a `config/initializers/pixnet-sso.rb` that looks like:
22
+ Execute `rails g pixnet_sso:install`, and follow the question it asks you.
23
23
 
24
- PIXNET::SSO.config do |config|
25
- config.user_model = 'User'
26
- config.sso_key = ENV['SSO_KEY']
27
- config.sso_secret = ENV['SSO_SECRET']
28
- # option: openid
29
- config.openid_model = 'OpenidAssociate'
30
- config.openid_enabled = true
31
- end
32
-
33
- And set your PIXNET SSO key pair to your ENV.
34
-
35
- ### MODEL AND MIGRATIONS:
36
-
37
- You should have models to store user/openid data.
24
+ It will generate `config/initializers/pixnet-sso.rb`, edit it to insert your SSO key pair of PIXNET.
38
25
 
39
26
  ### LOAD SCIRPTS IN YOUR LAYOUT:
40
27
 
@@ -44,8 +31,8 @@ Add `<%= pixnet_sso_scripts %>` in your `layout/application.html.erb` to enable
44
31
 
45
32
  Add code in your `app/controllers/application_controller`:
46
33
 
47
- include Pixnet::SSO::ControllerMethods
48
- include Pixnet::SSO::OpenidControllerMethods
34
+ include Pixnet::SSO::ControllerMethods
35
+ include Pixnet::SSO::OpenidControllerMethods #if you enabled openid
49
36
 
50
37
  ## LICENSE:
51
38
 
@@ -21,7 +21,7 @@ module Pixnet
21
21
  return false
22
22
  else
23
23
  if user.new_record?
24
- user.save(false)
24
+ user.save(:validate => false)
25
25
  end
26
26
 
27
27
  return user
@@ -5,6 +5,14 @@ require 'uuid'
5
5
  module Pixnet
6
6
  module SSO
7
7
  module Helper
8
+ def pixnet_login_url
9
+ "http://www.pixnet.net/?done=#{url_encode(request.url)}"
10
+ end
11
+
12
+ def pixnet_logout_url
13
+ "http://panel.pixnet.cc/logout?done=#{url_encode(request.url)}"
14
+ end
15
+
8
16
  def pixnet_sso_scripts
9
17
  now = Time.now.to_i.to_s
10
18
  unique = Zlib.crc32(UUID.generate).to_s
metadata CHANGED
@@ -1,127 +1,103 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: pixnet-sso
3
- version: !ruby/object:Gem::Version
4
- hash: 27
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 2
10
- version: 0.0.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Manic Chuang
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-11-09 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- version_requirements: &id001 !ruby/object:Gem::Requirement
12
+ date: 2011-11-15 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: &14348620 !ruby/object:Gem::Requirement
22
17
  none: false
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- hash: 7
27
- segments:
28
- - 3
29
- - 0
30
- - 0
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
31
21
  version: 3.0.0
32
- requirement: *id001
33
- prerelease: false
34
22
  type: :runtime
35
- name: rails
36
- - !ruby/object:Gem::Dependency
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
38
- none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
46
- requirement: *id002
47
23
  prerelease: false
48
- type: :runtime
24
+ version_requirements: *14348620
25
+ - !ruby/object:Gem::Dependency
49
26
  name: uuid
50
- - !ruby/object:Gem::Dependency
51
- version_requirements: &id003 !ruby/object:Gem::Requirement
27
+ requirement: &14347920 !ruby/object:Gem::Requirement
52
28
  none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- hash: 3
57
- segments:
58
- - 0
59
- version: "0"
60
- requirement: *id003
61
- prerelease: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
62
33
  type: :runtime
34
+ prerelease: false
35
+ version_requirements: *14347920
36
+ - !ruby/object:Gem::Dependency
63
37
  name: json
38
+ requirement: &14347320 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *14347320
64
47
  description: Client for PIXNET SSO
65
- email:
48
+ email:
66
49
  - manic@pixnet.tw
67
50
  executables: []
68
-
69
51
  extensions: []
70
-
71
52
  extra_rdoc_files: []
72
-
73
- files:
53
+ files:
74
54
  - app/controllers/pixauth_controller.rb
75
55
  - config/routes.rb
76
- - lib/pixnet-sso/controller_methods.rb
77
- - lib/pixnet-sso/railtie.rb
78
- - lib/pixnet-sso/openid_controller_methods.rb
79
- - lib/pixnet-sso/config.rb
80
- - lib/pixnet-sso/helper.rb
81
- - lib/pixnet-sso/app.rb
56
+ - lib/tasks/pixnet-sso_tasks.rake
82
57
  - lib/pixnet-sso.rb
83
- - lib/generators/pixnet_sso/install_generator.rb
84
- - lib/generators/pixnet_sso/templates/config.rb
85
58
  - lib/generators/pixnet_sso/templates/openid_associate.rb
86
- - lib/generators/pixnet_sso/templates/migration_openid.rb
87
- - lib/generators/pixnet_sso/templates/user.rb
88
59
  - lib/generators/pixnet_sso/templates/migration.rb
89
- - lib/tasks/pixnet-sso_tasks.rake
60
+ - lib/generators/pixnet_sso/templates/user.rb
61
+ - lib/generators/pixnet_sso/templates/migration_openid.rb
62
+ - lib/generators/pixnet_sso/templates/config.rb
63
+ - lib/generators/pixnet_sso/install_generator.rb
64
+ - lib/pixnet-sso/helper.rb
65
+ - lib/pixnet-sso/railtie.rb
66
+ - lib/pixnet-sso/openid_controller_methods.rb
67
+ - lib/pixnet-sso/controller_methods.rb
68
+ - lib/pixnet-sso/app.rb
69
+ - lib/pixnet-sso/config.rb
90
70
  - MIT-LICENSE
91
71
  - Rakefile
92
72
  - README.md
93
73
  homepage: https://github.com/manic/pixnet-sso
94
74
  licenses: []
95
-
96
75
  post_install_message:
97
76
  rdoc_options: []
98
-
99
- require_paths:
77
+ require_paths:
100
78
  - lib
101
- required_ruby_version: !ruby/object:Gem::Requirement
79
+ required_ruby_version: !ruby/object:Gem::Requirement
102
80
  none: false
103
- requirements:
104
- - - ">="
105
- - !ruby/object:Gem::Version
106
- hash: 3
107
- segments:
81
+ requirements:
82
+ - - ! '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ segments:
108
86
  - 0
109
- version: "0"
110
- required_rubygems_version: !ruby/object:Gem::Requirement
87
+ hash: -409314474799638778
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
111
89
  none: false
112
- requirements:
113
- - - ">="
114
- - !ruby/object:Gem::Version
115
- hash: 3
116
- segments:
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ segments:
117
95
  - 0
118
- version: "0"
96
+ hash: -409314474799638778
119
97
  requirements: []
120
-
121
98
  rubyforge_project:
122
99
  rubygems_version: 1.8.10
123
100
  signing_key:
124
101
  specification_version: 3
125
102
  summary: Client for PIXNET SSO
126
103
  test_files: []
127
-