omniauth-steam 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,70 @@
1
+ # OmniAuth Steam
2
+
3
+ This gem is an OmniAuth 1.0 strategy, supporting the OpenID Steam API.
4
+
5
+ ## Usage
6
+
7
+ Add to your `Gemfile`:
8
+
9
+ ```ruby
10
+ gem 'omniauth-steam'
11
+ ```
12
+
13
+ And then integrate the strategy into your middleware:
14
+
15
+ ```ruby
16
+ use OmniAuth::Builder do
17
+ provider :steam, ENV['STEAM_WEB_API_KEY']
18
+ end
19
+ ```
20
+
21
+ If you are using Rails, you may want to add it to the middleware stack:
22
+
23
+ ```ruby
24
+ Rails.application.config.middleware.use OmniAuth::Builder do
25
+ provider :steam, ENV['STEAM_WEB_API_KEY']
26
+ end
27
+ ```
28
+
29
+ You will need to inform your steam web API key to be able to retrieve information about the authenticated user. You can request one by filling out [this form](http://steamcommunity.com/dev/apikey).
30
+
31
+ For additional information, please refer to the [OmniAuth wiki](https://github.com/intridea/omniauth/wiki).
32
+
33
+ ## Authentication Hash
34
+
35
+ Here's an example of the *Authentication Hash* available in `request.env['omniauth.auth']`
36
+
37
+ ```ruby
38
+ {
39
+ :provider => "steam",
40
+ :uid => "76561198010202071",
41
+ :info => {
42
+ :nickname => "Reu",
43
+ :name => "Rodrigo Navarro",
44
+ :location => "BR",
45
+ :image => "http://media.steampowered.com/steamcommunity/public/images/avatars/3c/3c91a935dca0c1e243f3a67a198b0abea9cf6d48_medium.jpg",
46
+ :urls => {
47
+ :Profile => "http://steamcommunity.com/id/rnavarro1/"
48
+ }
49
+ },
50
+ :credentials => {},
51
+ :extra => {
52
+ :raw_info => {
53
+ :steamid => "76561198010202071",
54
+ :communityvisibilitystate => 3,
55
+ :profilestate => 1,
56
+ :personaname => "Reu",
57
+ :lastlogoff => 1325637158,
58
+ :profileurl => "http://steamcommunity.com/id/rnavarro1/",
59
+ :avatar => "http://media.steampowered.com/steamcommunity/public/images/avatars/3c/3c91a935dca0c1e243f3a67a198b0abea9cf6d48.jpg",
60
+ :avatarmedium => "http://media.steampowered.com/steamcommunity/public/images/avatars/3c/3c91a935dca0c1e243f3a67a198b0abea9cf6d48_medium.jpg",
61
+ :avatarfull => "http://media.steampowered.com/steamcommunity/public/images/avatars/3c/3c91a935dca0c1e243f3a67a198b0abea9cf6d48_full.jpg",
62
+ :personastate => 1,
63
+ :realname => "Rodrigo Navarro",
64
+ :primaryclanid => "103582791432706194",
65
+ :timecreated => 1243031082,
66
+ :loccountrycode => "BR"
67
+ }
68
+ }
69
+ }
70
+ ```
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Steam
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
@@ -1,3 +1,6 @@
1
+ require 'omniauth-openid'
2
+ require 'multi_json'
3
+
1
4
  module OmniAuth
2
5
  module Strategies
3
6
  class Steam < OmniAuth::Strategies::OpenID
@@ -32,7 +35,7 @@ module OmniAuth
32
35
  end
33
36
 
34
37
  def player
35
- @player ||= raw_info["response"]["players"]["player"].first
38
+ @player ||= raw_info["response"]["players"].first
36
39
  end
37
40
 
38
41
  def steam_id
@@ -40,7 +43,7 @@ module OmniAuth
40
43
  end
41
44
 
42
45
  def player_profile_uri
43
- URI.parse("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0001/?key=#{options.api_key}&steamids=#{steam_id}")
46
+ URI.parse("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=#{options.api_key}&steamids=#{steam_id}")
44
47
  end
45
48
  end
46
49
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-steam
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
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-01-03 00:00:00.000000000Z
12
+ date: 2013-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth-openid
16
- requirement: &2156030380 !ruby/object:Gem::Requirement
16
+ requirement: &2157330620 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2156030380
24
+ version_requirements: *2157330620
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: multi_json
27
- requirement: &2156393460 !ruby/object:Gem::Requirement
27
+ requirement: &2157379280 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2156393460
35
+ version_requirements: *2157379280
36
36
  description:
37
37
  email:
38
38
  - rnavarro1@gmail.com
@@ -42,6 +42,7 @@ extra_rdoc_files: []
42
42
  files:
43
43
  - .gitignore
44
44
  - Gemfile
45
+ - README.md
45
46
  - Rakefile
46
47
  - lib/omniauth-steam.rb
47
48
  - lib/omniauth-steam/version.rb
@@ -61,7 +62,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
61
62
  version: '0'
62
63
  segments:
63
64
  - 0
64
- hash: 3343329316515483262
65
+ hash: 1028665889094254047
65
66
  required_rubygems_version: !ruby/object:Gem::Requirement
66
67
  none: false
67
68
  requirements:
@@ -70,10 +71,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
71
  version: '0'
71
72
  segments:
72
73
  - 0
73
- hash: 3343329316515483262
74
+ hash: 1028665889094254047
74
75
  requirements: []
75
76
  rubyforge_project: omniauth-steam
76
- rubygems_version: 1.8.10
77
+ rubygems_version: 1.8.11
77
78
  signing_key:
78
79
  specification_version: 3
79
80
  summary: Steam strategy for OmniAuth