warden-browserid 0.7.8 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +13 -2
- data/lib/warden-browserid/config.rb +1 -1
- data/lib/warden-browserid/strategy.rb +6 -2
- data/lib/warden-browserid/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -24,11 +24,22 @@ config/initializers/devise.rb in Rails:
|
|
24
24
|
```ruby
|
25
25
|
config.warden do |manager|
|
26
26
|
manager.default_strategies(:scope => :user).unshift :browserid
|
27
|
-
manager.browserid_url = "dev.diresworb.org"
|
28
27
|
end
|
29
28
|
```
|
29
|
+
See the [Warden wiki] for other usage. The following option is
|
30
|
+
available, since [Mozilla] [1] says to use BrowserID as follows:
|
31
|
+
```ruby
|
32
|
+
# manager.browserid_url = "dev.diresworb.org" # Development
|
33
|
+
(default)
|
34
|
+
# manager.browserid_url = "diresworb.org" # Beta
|
35
|
+
# manager.browserid_url = "browserid.org" # Production
|
36
|
+
```
|
37
|
+
|
38
|
+
I use the [devise-browserid] gem
|
39
|
+
to enable client side action for BrowserID.
|
30
40
|
|
31
|
-
|
41
|
+
[1]: https://github.com/hassox/warden/wiki/Setup "Warden wiki"
|
42
|
+
[2]: https://github.com/ringe/devise-browserid "devise-browserid"
|
32
43
|
|
33
44
|
## Contributing
|
34
45
|
|
@@ -11,7 +11,7 @@ module Warden
|
|
11
11
|
return false unless params[:assertion]
|
12
12
|
|
13
13
|
# Prepare the HTTP request
|
14
|
-
http = Net::HTTP.new(browserid_url, 443)
|
14
|
+
http = Net::HTTP.new(Strategy.browserid_url, 443)
|
15
15
|
http.use_ssl = true
|
16
16
|
req = Net::HTTP::Post.new("/verify")
|
17
17
|
req.set_form_data( { assertion: params[:assertion], audience: request.host_with_port } )
|
@@ -34,7 +34,11 @@ module Warden
|
|
34
34
|
|
35
35
|
# Select BrowserID verifier instance from options
|
36
36
|
def self.browserid_url
|
37
|
-
|
37
|
+
begin
|
38
|
+
request.env['warden'].config.browserid_url
|
39
|
+
rescue NameError
|
40
|
+
"dev.diresworb.org"
|
41
|
+
end
|
38
42
|
end
|
39
43
|
end
|
40
44
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warden-browserid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-16 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: warden
|
16
|
-
requirement: &
|
16
|
+
requirement: &9189640 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *9189640
|
25
25
|
description: Warden BrowserID strategy
|
26
26
|
email:
|
27
27
|
- runar@rin.no
|