omniauth-bluenumber 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -3
- data/lib/omniauth/bluenumber/version.rb +1 -1
- data/lib/omniauth/strategies/bluenumber.rb +27 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b0617a53f1dc88d93baf4894b7f14bf252d5207
|
4
|
+
data.tar.gz: dc807aafacfd22b5313d4329cf426a6a91cf4684
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: add472d8e7ad5e3637c8deb9fbbb1fbaf8f7dfa88792ca7bdcb5ec1c6382a0d855bfacbf25cf14d3ccd05020737dd8e0b99dc0d62f24954dd96e46147352a2c8
|
7
|
+
data.tar.gz: 35679151279d976f73ee28a51d2e4c17e3354ac61bb7d74d2f48ddd726a7526976ad8d18c2670d1756419d3b5c155448f970d2bad37b1cf3a15e1499bce2e8ae
|
data/README.md
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
# Omniauth::Bluenumber
|
2
2
|
|
3
|
+
[![Code Climate](https://codeclimate.com/github/sachin87/omniauth-bluenumber/badges/gpa.svg)](https://codeclimate.com/github/sachin87/omniauth-bluenumber)
|
4
|
+
|
5
|
+
[![Test Coverage](https://codeclimate.com/github/sachin87/omniauth-bluenumber/badges/coverage.svg)](https://codeclimate.com/github/sachin87/omniauth-bluenumber/coverage)
|
6
|
+
|
7
|
+
[![Issue Count](https://codeclimate.com/github/sachin87/omniauth-bluenumber/badges/issue_count.svg)](https://codeclimate.com/github/sachin87/omniauth-bluenumber)
|
8
|
+
|
3
9
|
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/omniauth/bluenumber`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
10
|
|
5
|
-
|
11
|
+
Omniauth Strategies for Bluenumber
|
6
12
|
|
7
13
|
## Installation
|
8
14
|
|
@@ -22,7 +28,7 @@ Or install it yourself as:
|
|
22
28
|
|
23
29
|
## Usage
|
24
30
|
|
25
|
-
|
31
|
+
# later
|
26
32
|
|
27
33
|
## Development
|
28
34
|
|
@@ -32,5 +38,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
38
|
|
33
39
|
## Contributing
|
34
40
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
41
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Sachin87/omniauth-bluenumber.
|
36
42
|
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module OmniAuth
|
2
2
|
module Strategies
|
3
3
|
class Bluenumber < OmniAuth::Strategies::OAuth2
|
4
|
-
|
4
|
+
|
5
|
+
option :name, 'bluenumber'
|
5
6
|
|
6
7
|
option :client_options, {
|
7
8
|
site: "http://localhost:3000",
|
@@ -13,11 +14,34 @@ module OmniAuth
|
|
13
14
|
end
|
14
15
|
|
15
16
|
info do
|
16
|
-
{
|
17
|
+
{email: email, bluenumber: bluenumber,
|
18
|
+
username: username, actor_id: actor_id}
|
17
19
|
end
|
18
20
|
|
21
|
+
def localhost
|
22
|
+
"http://localhost:3000"
|
23
|
+
end
|
24
|
+
|
25
|
+
def email
|
26
|
+
raw_info['email']
|
27
|
+
end
|
28
|
+
|
29
|
+
def bluenumber
|
30
|
+
raw_info['bluenumber']
|
31
|
+
end
|
32
|
+
|
33
|
+
def username
|
34
|
+
raw_info['username']
|
35
|
+
end
|
36
|
+
|
37
|
+
def actor_id
|
38
|
+
raw_info['ActorID']
|
39
|
+
end
|
40
|
+
|
19
41
|
def raw_info
|
20
|
-
@raw_info ||=
|
42
|
+
@raw_info ||= access_token.get('/gpr/v2/users/user_info').parsed
|
43
|
+
rescue ::Errno::ETIMEDOUT
|
44
|
+
raise ::Timeout::Error
|
21
45
|
end
|
22
46
|
end
|
23
47
|
end
|