devise-heroku-sso 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/devise-heroku-sso.rb +3 -1
- data/lib/devise-heroku-sso/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85e1fe7307f12d5b6ea6ca5eab6f56aaf93108a7
|
4
|
+
data.tar.gz: 56a46a969a8b714e8af9f03218a98aa24c36be0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a66bc2798d8cec27466b6d5631d10046574721265a86b64d657bb7662d7be5900a074715445bfb912c4d8a8377711a71cbc767eee496ee8dcbc1e2674c4a8b4
|
7
|
+
data.tar.gz: 801076e5c9e6fb916ec5ffbbd40009fe7608ddd1f28f0db02ea2f98174f2d44ea6486bf664d7fa3cdccfbe2a656872ea288c72d7f325d1bf2d5c2144f3ce5b76
|
data/README.md
CHANGED
@@ -31,6 +31,10 @@ Example of the routes.rb:
|
|
31
31
|
|
32
32
|
This line mounts devise to default sso path which kensa gem uses.
|
33
33
|
|
34
|
+
## Example rails app with devise-heroku-sso gem
|
35
|
+
|
36
|
+
Rails template for kensa: https://github.com/Proffard/kensa-create-rails
|
37
|
+
|
34
38
|
## Contributing
|
35
39
|
|
36
40
|
1. Fork it ( http://github.com/<my-github-username>/devise-heroku-sso/fork )
|
data/lib/devise-heroku-sso.rb
CHANGED
@@ -3,6 +3,7 @@ require 'devise/strategies/authenticatable'
|
|
3
3
|
module HerokuSso
|
4
4
|
class CustomStrategy < Devise::Strategies::Authenticatable
|
5
5
|
def valid?
|
6
|
+
::Rails.logger.warn "[HEROKU-SSO] valid: #{valid_token} && #{!token_expired?} "
|
6
7
|
valid_token? && !token_expired?
|
7
8
|
end
|
8
9
|
|
@@ -37,6 +38,7 @@ module HerokuSso
|
|
37
38
|
end
|
38
39
|
|
39
40
|
def token
|
41
|
+
::Rails.logger.warn "[HEROKU-SSO] #{pre-token} -> #{Digest::SHA1.hexdigest(pre_token).to_s}"
|
40
42
|
Digest::SHA1.hexdigest(pre_token).to_s
|
41
43
|
end
|
42
44
|
|
@@ -45,7 +47,7 @@ module HerokuSso
|
|
45
47
|
end
|
46
48
|
|
47
49
|
def token_expired?
|
48
|
-
params[:timestamp].to_i < (Time.now -
|
50
|
+
params[:timestamp].to_i < (Time.now - 5.minutes).to_i
|
49
51
|
end
|
50
52
|
end
|
51
53
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise-heroku-sso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikolay Samokhin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|