omniauth-edumall 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth-edumall.rb +1 -0
- data/lib/omniauth/edumall.rb +2 -0
- data/lib/omniauth/edumall/version.rb +5 -0
- data/lib/omniauth/strategies/edumall.rb +35 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 144fd3aa795724338186ed98df2c13a9d683a81e
|
4
|
+
data.tar.gz: 3836ac1ef8478fc5e5c093d65c9522ffc83c0b6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 714b7d07ca43cc5fdd2749cc5eb7cfdbcafebb7a2f663b9da6844a8101f062fcda85933940a49945fb5b0b01cddb1cad3a67bc141c1a4559b23b4332c1dc4dd8
|
7
|
+
data.tar.gz: ce4184f8fc54d285a6dc32c6f98d87afd3b2d372387cf639e5c64cba778cb72ddc8cca1ddede9c3c9a7e6e56a87e917eda93f06047020c090d0f6b1b1de3babd
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'omniauth/edumall'
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'omniauth-oauth2'
|
2
|
+
module OmniAuth
|
3
|
+
module Strategies
|
4
|
+
class Edumall < OmniAuth::Strategies::OAuth2
|
5
|
+
CUSTOM_PROVIDER_URL = 'https://accounts.edumall.vn'
|
6
|
+
|
7
|
+
option :client_options, {
|
8
|
+
:site => CUSTOM_PROVIDER_URL,
|
9
|
+
:authorize_url => "#{CUSTOM_PROVIDER_URL}/auth/sso/authorize",
|
10
|
+
:access_token_url => "#{CUSTOM_PROVIDER_URL}/auth/sso/access_token"
|
11
|
+
}
|
12
|
+
|
13
|
+
uid do
|
14
|
+
raw_info['id']
|
15
|
+
end
|
16
|
+
|
17
|
+
info do
|
18
|
+
{
|
19
|
+
email: raw_info['email'],
|
20
|
+
name: raw_info['name'],
|
21
|
+
avatar: raw_info['image'],
|
22
|
+
verified: raw_info['verified']
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
extra do
|
27
|
+
{ :raw_info => raw_info}
|
28
|
+
end
|
29
|
+
|
30
|
+
def raw_info
|
31
|
+
@raw_info ||= access_token.get("/auth/sso/user.json?oauth_token=#{access_token.token}").parsed
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-edumall
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hoptq
|
@@ -77,6 +77,10 @@ extra_rdoc_files: []
|
|
77
77
|
files:
|
78
78
|
- bin/console
|
79
79
|
- bin/setup
|
80
|
+
- lib/omniauth-edumall.rb
|
81
|
+
- lib/omniauth/edumall.rb
|
82
|
+
- lib/omniauth/edumall/version.rb
|
83
|
+
- lib/omniauth/strategies/edumall.rb
|
80
84
|
- test/omniauth/edumall_test.rb
|
81
85
|
- test/test_helper.rb
|
82
86
|
homepage: https://accounts.edumall.vn
|