omniauth-fortnox-oauth2 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +0 -11
- data/lib/omniauth/fortnox_oauth2/version.rb +1 -1
- data/lib/omniauth/strategies/fortnox_oauth2.rb +1 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b4205196f555885b665f46c8133c393375e402004fd5f649afdeb37550baf53
|
4
|
+
data.tar.gz: c801df59317f0ea20f13c128e14bc37e9805d921987057f2ad4dd10c54f43037
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 965555b3e2b1fd7ab763875cb58f460b1979777df3b4e09fd9c7cd9a3552288ea27bec775256e027f6b907067bcb87e5618d8358edaff06bf92b08d4e3120e8e
|
7
|
+
data.tar.gz: b853caf7304547f7660366a0f43c0637a16edf0221516432a8e35bb506323dc7c8037b495af8e4e41e073fcaf367c489f0b6adf7dd2192bf19fd83b25e421bd3
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -79,17 +79,6 @@ You can also configure the `client_options` by passing in any of the following s
|
|
79
79
|
|
80
80
|
* `token_method`: Override the token_method used by the gem, default `:post`.
|
81
81
|
|
82
|
-
## Note
|
83
|
-
Currently the only way to support multiple redirect uri's in Fortnox is to add them sperated using ` ` (space). This will work for the initial request to get the authorization code.
|
84
|
-
When trading the code for a token the `redirect_uri` will be matched using the string used in Fortnox developer portal. This is beeing changed but for now the workaround is to pass that string.
|
85
|
-
This can here be passed as an option `fortnox_redirect_uri`, it can contain one or multiple uri's.
|
86
|
-
This will need to exactly match the string in Fortnox.
|
87
|
-
|
88
|
-
For example:
|
89
|
-
```ruby
|
90
|
-
env['omniauth.strategy'].options[:fortnox_redirect_uri] = 'https://test.test/callback https://second-test.test/callback'
|
91
|
-
```
|
92
|
-
|
93
82
|
## Auth Hash
|
94
83
|
|
95
84
|
Here's an example of an authentication hash available in the callback by accessing `request.env['omniauth.auth']`:
|
@@ -67,21 +67,12 @@ module OmniAuth
|
|
67
67
|
options[:callback_url] || (full_host + script_name + callback_path)
|
68
68
|
end
|
69
69
|
|
70
|
-
# Currently the only way to support multiple redirect uri's in Fortnox
|
71
|
-
# is to add them sperated using ` ` (space). This will work for the
|
72
|
-
# initial request to get the authorization code.
|
73
|
-
# When trading the code for a token the `redirect_uri` will be matched
|
74
|
-
# using the string entered in Fortnox developer portal. This is beeing
|
75
|
-
# changed but for now the workaround is to pass that string.
|
76
|
-
# It can contain one or multiple uri's.
|
77
|
-
#
|
78
70
|
def build_access_token
|
79
|
-
redirect_uri = options.fortnox_redirect_uri || callback_url
|
80
71
|
verifier = request.params['code']
|
81
72
|
|
82
73
|
client.auth_code.get_token(
|
83
74
|
verifier,
|
84
|
-
{ redirect_uri:
|
75
|
+
{ redirect_uri: callback_url }.merge(token_params.to_hash(symbolize_keys: true)),
|
85
76
|
deep_symbolize(options.auth_token_params)
|
86
77
|
)
|
87
78
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-fortnox-oauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- svenne87
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|