omniauth-edumall 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5adbeef3a00235d195c5db192ea84052a876eb9
4
- data.tar.gz: 81c8f4e5465a18b10f6f2af9595f3a33c10c637e
3
+ metadata.gz: 144fd3aa795724338186ed98df2c13a9d683a81e
4
+ data.tar.gz: 3836ac1ef8478fc5e5c093d65c9522ffc83c0b6d
5
5
  SHA512:
6
- metadata.gz: 060332c449dd919ca9b4e7b242a456dc85b9c13ff1abfab6201c7e27842714866b8f43dc1ab52bfb725e17d24c51f9252f1ae92e34341586386fce1fa1125f7c
7
- data.tar.gz: b33fc0a1fb9eba7c5a5546faf14251d0b1343f5dc91db7fe0ad63d2bbe53a9439b6b358f53c4ba72d1049226570fe3ec1a9d989591609feac13688835fc99aa0
6
+ metadata.gz: 714b7d07ca43cc5fdd2749cc5eb7cfdbcafebb7a2f663b9da6844a8101f062fcda85933940a49945fb5b0b01cddb1cad3a67bc141c1a4559b23b4332c1dc4dd8
7
+ data.tar.gz: ce4184f8fc54d285a6dc32c6f98d87afd3b2d372387cf639e5c64cba778cb72ddc8cca1ddede9c3c9a7e6e56a87e917eda93f06047020c090d0f6b1b1de3babd
@@ -0,0 +1 @@
1
+ require 'omniauth/edumall'
@@ -0,0 +1,2 @@
1
+ require 'omniauth/edumall/version'
2
+ require 'omniauth/strategies/edumall'
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Edumall
3
+ VERSION = "0.1.4"
4
+ end
5
+ end
@@ -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.3
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