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 +5 -5
- data/lib/omniauth/class_link/version.rb +1 -1
- data/lib/omniauth/strategies/class_link.rb +56 -54
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ca8fa1c810c18758795a7bccfa4425dd772eec89d0dc2bec1c19e7d713baa7de
|
4
|
+
data.tar.gz: 510cb001e405a4522022a6d98b17e43810621dfc6b75f034567b2f9210d8fa4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0112f46b3eda935bd121e4ca0043caa6f8fabf1f1e1e8638932768b3481fbb0b8f6add13bc97deebf2552b866e13c3c8ab197f444871e444195a1361cef973be
|
7
|
+
data.tar.gz: 9b8b8da450dffcce36c6ad59269129846fc337f6f65f79e660caa4ea4a4ce2271aa72214c1115dccd779f0fccd69b413d63b82089012de9dad0fe3e2f01f0536
|
@@ -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
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
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.
|
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:
|
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
|
-
|
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
|