omniauth-classlink 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: dab291d18409c59b41701938a3dd55f55e1be7e9
4
- data.tar.gz: 7d309138fbe2ffee3e609bb9d587da11e98aa950
2
+ SHA256:
3
+ metadata.gz: ca8fa1c810c18758795a7bccfa4425dd772eec89d0dc2bec1c19e7d713baa7de
4
+ data.tar.gz: 510cb001e405a4522022a6d98b17e43810621dfc6b75f034567b2f9210d8fa4d
5
5
  SHA512:
6
- metadata.gz: ed64dbba5999e0723bcedba8971acd378223c8e03c9a6331d5eba2e206c794c1c77099c4a00709be2cf0e6e33c605603505074442668f41c4e8f086e555e6a0d
7
- data.tar.gz: cc4e11bdb40577af1f3c1c6a535c9cceb18cb1d0de215c21ed32d640af0ea7d6e235f50e7db682386d810f1b84d1a239203b9d442daddf99f66c9efa8cfab3b9
6
+ metadata.gz: 0112f46b3eda935bd121e4ca0043caa6f8fabf1f1e1e8638932768b3481fbb0b8f6add13bc97deebf2552b866e13c3c8ab197f444871e444195a1361cef973be
7
+ data.tar.gz: 9b8b8da450dffcce36c6ad59269129846fc337f6f65f79e660caa4ea4a4ce2271aa72214c1115dccd779f0fccd69b413d63b82089012de9dad0fe3e2f01f0536
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module ClassLink
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
@@ -1,54 +1,56 @@
1
- require 'omniauth-oauth2'
2
- require 'base64'
3
-
4
- module OmniAuth
5
- module Strategies
6
- class ClassLink < OmniAuth::Strategies::OAuth2
7
- option :name, :classlink
8
- option :client_options, {
9
- site: 'https://launchpad.classlink.com',
10
- authorize_url: '/oauth2/v2/auth',
11
- token_url: '/oauth2/v2/token'
12
- }
13
- option :fields, [:email, :profile]
14
- option :uid_field, 'UserId'
15
-
16
- uid do
17
- raw_info[options.uid_field.to_s]
18
- end
19
-
20
- def authorize_params
21
- super.tap do |params|
22
- params[:scope] = [:email, :profile]
23
- params[:response_type] = :code
24
- end
25
- end
26
-
27
- info do
28
- {
29
- first_name: raw_info['FirstName'],
30
- last_name: raw_info['LastName'],
31
- district_id: raw_info['TenantId'],
32
- classlink_id: raw_info['UserId'],
33
- external_id: raw_info['SourcedId'],
34
- role: raw_info['Role']
35
- }
36
- end
37
-
38
- extra do
39
- { 'raw_info' => raw_info }
40
- end
41
-
42
- def raw_info
43
- @raw_info ||= access_token.get('https://nodeapi.classlink.com/v2/my/info').parsed
44
- end
45
-
46
- private
47
-
48
- def callback_url
49
- # You can overwrite it for development purposes
50
- options[:redirect_uri] || super
51
- end
52
- end
53
- end
54
- end
1
+ require 'omniauth-oauth2'
2
+ require 'base64'
3
+
4
+ module OmniAuth
5
+ module Strategies
6
+ class ClassLink < OmniAuth::Strategies::OAuth2
7
+ option :name, :classlink
8
+ option :client_options, {
9
+ site: 'https://launchpad.classlink.com',
10
+ authorize_url: '/oauth2/v2/auth',
11
+ token_url: '/oauth2/v2/token'
12
+ }
13
+ option :fields, [:email, :profile]
14
+ option :uid_field, 'UserId'
15
+
16
+ uid do
17
+ raw_info[options.uid_field.to_s]
18
+ end
19
+
20
+ def authorize_params
21
+ super.tap do |params|
22
+ params[:scope] = [:email, :profile]
23
+ params[:response_type] = :code
24
+ end
25
+ end
26
+
27
+ info do
28
+ {
29
+ first_name: raw_info['FirstName'],
30
+ last_name: raw_info['LastName'],
31
+ district_id: raw_info['TenantId'],
32
+ classlink_id: raw_info['UserId'],
33
+ external_id: raw_info['SourcedId'],
34
+ role: raw_info['Role'],
35
+ email: raw_info['Email'],
36
+ image: raw_info['ImagePath']
37
+ }
38
+ end
39
+
40
+ extra do
41
+ { 'raw_info' => raw_info }
42
+ end
43
+
44
+ def raw_info
45
+ @raw_info ||= access_token.get('https://nodeapi.classlink.com/v2/my/info').parsed
46
+ end
47
+
48
+ private
49
+
50
+ def callback_url
51
+ # You can overwrite it for development purposes
52
+ options[:redirect_uri] || super
53
+ end
54
+ end
55
+ end
56
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-classlink
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kamil Bednarz
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
11
  - gem-public_cert.pem
12
- date: 2019-12-11 00:00:00.000000000 Z
12
+ date: 2020-11-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth-oauth2
@@ -61,8 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  requirements: []
64
- rubyforge_project:
65
- rubygems_version: 2.5.2.3
64
+ rubygems_version: 3.0.3
66
65
  signing_key:
67
66
  specification_version: 4
68
67
  summary: The unofficial strategy for authenticating users using launchpad.classlink.com