omniauth-slack 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -27
- data/lib/omniauth/strategies/slack.rb +12 -12
- data/lib/omniauth-slack/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a06a665cd9165067e6e52446714beafda6b38a84
|
4
|
+
data.tar.gz: dc3037e97c68103cc4066f2ee3d77112021b2c76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c357611664892c40b920d7b9fc6b407f41e9c2d9b1ae6fb002ff5e49664fe1830f7a387e2e44f64d73cf27b0b61fde97cbf1b753eccccb61a45d7a941e5e8ee
|
7
|
+
data.tar.gz: 1e75caaec8fc5208827e1a150be0c9db6ee9ecaca6d88fa2ce55911c4fedec906fe5f1c61df9803923715e7928b2f377298597f744d7d408835d8c9446cfc64a
|
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
This Gem contains the Slack strategy for OmniAuth.
|
4
4
|
|
5
|
+
[](http://badge.fury.io/rb/omniauth-slack)
|
6
|
+
|
5
7
|
## Before You Begin
|
6
8
|
|
7
9
|
You should have already installed OmniAuth into your app; if not, read the [OmniAuth README](https://github.com/intridea/omniauth) to get started.
|
@@ -51,29 +53,6 @@ Slack lets you choose from a [few different scopes](https://api.slack.com/docs/o
|
|
51
53
|
|
52
54
|
## Authentication Options
|
53
55
|
|
54
|
-
### State
|
55
|
-
|
56
|
-
> *unique string to be passed back upon completion*
|
57
|
-
|
58
|
-
> The state parameter should be used to avoid forgery attacks by passing in a value that's unique to the user you're authenticating and checking it when auth completes.
|
59
|
-
|
60
|
-
for a logged in user, you might want to include state, for example with devise:
|
61
|
-
|
62
|
-
`https://www.yourapp.com/users/auth/slack?state=1234-foobutter`
|
63
|
-
|
64
|
-
creates an auth session with `state`
|
65
|
-
|
66
|
-
After a successful auth, the callback request will include `request.env["omniauth.params"]` hash
|
67
|
-
|
68
|
-
```ruby
|
69
|
-
class CallbackController < ApplicationController
|
70
|
-
def slack
|
71
|
-
request.env["omniauth.params"]["state"]
|
72
|
-
# => "1234-foobutter"
|
73
|
-
end
|
74
|
-
end
|
75
|
-
```
|
76
|
-
|
77
56
|
### Team
|
78
57
|
|
79
58
|
> If you don't pass a team param, the user will be allowed to choose which team they are authenticating against. Passing this param ensures the user will auth against an account on that particular team.
|
@@ -96,7 +75,3 @@ end
|
|
96
75
|
|
97
76
|
|
98
77
|
[](https://bitdeli.com/free "Bitdeli Badge")
|
99
|
-
|
100
|
-
|
101
|
-
[](https://bitdeli.com/free "Bitdeli Badge")
|
102
|
-
|
@@ -22,23 +22,23 @@ module OmniAuth
|
|
22
22
|
|
23
23
|
info do
|
24
24
|
{
|
25
|
-
name: user_info['user'].
|
26
|
-
email: user_info['user'].
|
25
|
+
name: user_info['user'].to_h['profile'].to_h['real_name_normalized'],
|
26
|
+
email: user_info['user'].to_h['profile'].to_h['email'],
|
27
27
|
nickname: raw_info['user'],
|
28
|
-
first_name: user_info['user'].
|
29
|
-
last_name: user_info['user'].
|
30
|
-
description: user_info['user'].
|
31
|
-
image_24: user_info['user'].
|
32
|
-
image_48: user_info['user'].
|
33
|
-
image: user_info['user'].
|
28
|
+
first_name: user_info['user'].to_h['profile'].to_h['first_name'],
|
29
|
+
last_name: user_info['user'].to_h['profile'].to_h['last_name'],
|
30
|
+
description: user_info['user'].to_h['profile'].to_h['title'],
|
31
|
+
image_24: user_info['user'].to_h['profile'].to_h['image_24'],
|
32
|
+
image_48: user_info['user'].to_h['profile'].to_h['image_48'],
|
33
|
+
image: user_info['user'].to_h['profile'].to_h['image_192'],
|
34
34
|
team: raw_info['team'],
|
35
35
|
user: raw_info['user'],
|
36
36
|
team_id: raw_info['team_id'],
|
37
|
-
team_domain: team_info['team']['domain'],
|
37
|
+
team_domain: team_info['team'].to_h['domain'],
|
38
38
|
user_id: raw_info['user_id'],
|
39
|
-
is_admin: user_info['user']['is_admin'],
|
40
|
-
is_owner: user_info['user']['is_owner'],
|
41
|
-
time_zone: user_info['user']['tz']
|
39
|
+
is_admin: user_info['user'].to_h['is_admin'],
|
40
|
+
is_owner: user_info['user'].to_h['is_owner'],
|
41
|
+
time_zone: user_info['user'].to_h['tz']
|
42
42
|
}
|
43
43
|
end
|
44
44
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-slack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kimura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.2.2
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: OmniAuth strategy for Slack
|