omniauth-cronofy 0.12.0 → 0.13.0
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 +4 -4
- data/README.md +13 -2
- data/lib/omniauth-cronofy/version.rb +1 -1
- data/lib/omniauth/strategies/cronofy.rb +16 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08d3b9fdad3eef4e29b24ad09e6dbb8c87740ac86d9fd031387df703f18856dc
|
4
|
+
data.tar.gz: af84bd469c6564fa31f23f5ca002b461bf8e3bfa25351a36e9f58a1e8b31aece
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cd2a1c4ee317bf542975101e2995f2cf8f0dbc4c72e3232cab695a8add8f8c9ecb2b2f95fdfb26574bd0ac10823c59d1c48ebca7994dd6f7717f2d7e025e917
|
7
|
+
data.tar.gz: 9662faaaccc65d370b6e9883e306e9d92c99d2aa9d812f960cbdf4452387e537dbca5929d998c9f2345af4087fe4d6c52007f593006228d4c2d18d9a4c23b322
|
data/README.md
CHANGED
@@ -43,19 +43,27 @@ Then to auth with Cronofy you would navigate to `/auth/cronofy`.
|
|
43
43
|
|
44
44
|
#### Explicit Linking
|
45
45
|
|
46
|
-
Cronofy supports [explicit linking of calendar accounts](https://
|
46
|
+
Cronofy supports [explicit linking of calendar accounts](https://docs.cronofy.com/developers/api-alpha/explicit-linking/) by passing a `link_token` to the auth flow. This strategy supports that token be passed as a query string parameter to the auth redirect.
|
47
47
|
|
48
48
|
```
|
49
49
|
/auth/cronofy?link_token=hga672376....
|
50
50
|
```
|
51
51
|
#### Avoid Linking
|
52
52
|
|
53
|
-
Cronofy supports [to avoid profiles to be linked](https://
|
53
|
+
Cronofy supports [to avoid profiles to be linked](https://docs.cronofy.com/developers/api/authorization/request-authorization/#avoid_linking) by passing an `avoid_linking` param with `true` value to the auth flow.
|
54
54
|
|
55
55
|
```
|
56
56
|
/auth/cronofy?avoid_linking=true
|
57
57
|
```
|
58
58
|
|
59
|
+
#### Provider Name
|
60
|
+
|
61
|
+
Cronofy allows the [pre-selection of a calendar provider](https://docs.cronofy.com/developers/api/authorization/request-authorization/#provider_name) in the auth flow using the `provider_name` param with one of the documented values.
|
62
|
+
|
63
|
+
```
|
64
|
+
/auth/cronofy?provider_name=office365
|
65
|
+
```
|
66
|
+
|
59
67
|
### Configuration
|
60
68
|
|
61
69
|
Configurable options
|
@@ -130,6 +138,7 @@ Configurable options
|
|
130
138
|
:provider => "cronofy_service_account",
|
131
139
|
:uid => "ser_382374827234",
|
132
140
|
:info => {
|
141
|
+
:common_name => "company.com",
|
133
142
|
:domain => "company.com"
|
134
143
|
},
|
135
144
|
:credentials => {
|
@@ -148,6 +157,8 @@ Configurable options
|
|
148
157
|
}
|
149
158
|
```
|
150
159
|
|
160
|
+
The `info` element may contain different elements, `domain` and/or `email` depending on the calendar service being integrated with. `common_name` is always returned.
|
161
|
+
|
151
162
|
## Contributing
|
152
163
|
|
153
164
|
1. Fork it ( https://github.com/[my-github-username]/omniauth-cronofy/fork )
|
@@ -1,6 +1,12 @@
|
|
1
1
|
module OmniAuth
|
2
2
|
module Strategies
|
3
3
|
class Cronofy < CronofyBase
|
4
|
+
WHITELISTED_AUTHORIZE_PARAMS = %w{
|
5
|
+
avoid_linking
|
6
|
+
link_token
|
7
|
+
provider_name
|
8
|
+
}
|
9
|
+
|
4
10
|
option :name, "cronofy"
|
5
11
|
|
6
12
|
uid { raw_info['account_id'] }
|
@@ -28,16 +34,18 @@ module OmniAuth
|
|
28
34
|
end
|
29
35
|
|
30
36
|
def request_phase
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
37
|
+
session_params = session['omniauth.params']
|
38
|
+
params = {}
|
39
|
+
|
40
|
+
WHITELISTED_AUTHORIZE_PARAMS.each do |param|
|
41
|
+
next unless session_params[param]
|
42
|
+
params[param] = session_params[param]
|
35
43
|
end
|
36
44
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
options[:authorize_params]
|
45
|
+
if options[:authorize_params]
|
46
|
+
options[:authorize_params].merge!(params)
|
47
|
+
else
|
48
|
+
options[:authorize_params] = params
|
41
49
|
end
|
42
50
|
|
43
51
|
super
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-cronofy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Bird
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
version: '0'
|
112
112
|
requirements: []
|
113
113
|
rubyforge_project:
|
114
|
-
rubygems_version: 2.7.
|
114
|
+
rubygems_version: 2.7.8
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: OmniAuth strategy for authenticating with Cronofy
|