omniauth-tiktok-oauth2 0.1.6 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth/strategies/tiktok_oauth2.rb +16 -5
- data/lib/omniauth-tiktok-oauth2/version.rb +1 -1
- data/omniauth-tiktok-oauth2.gemspec +2 -2
- metadata +9 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0f7c838a11854fa944be3dbf59c7e0321821186d9d9ae3a5dd3623cfef90f79
|
4
|
+
data.tar.gz: 1ac288f82bc6e9e6a616dc4b2805646860a748b421e122ae22ce2b2cbfb9b6c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84a724a5f1ed24bdefac94b59dfa40f41d0b80c67f6036a86290fdefe25605d1a988cf51de99c953985929945da6de91604956b3872f492b7cb2eca43dcb00cd
|
7
|
+
data.tar.gz: ffe4b51ca8d2e00dffbeac9b4132af5728aacf7623f3d229c46680768e0796661e5474f158f9b03559c2c2a710bd9b324914b1e10f9ce6eabc6f44a9cc9e83e6
|
@@ -8,12 +8,12 @@ end
|
|
8
8
|
module OmniAuth
|
9
9
|
module Strategies
|
10
10
|
class TiktokOauth2 < OmniAuth::Strategies::OAuth2
|
11
|
-
USER_INFO_URL = 'https://business-api.tiktok.com/open_api/v1.
|
11
|
+
USER_INFO_URL = 'https://business-api.tiktok.com/open_api/v1.3/user/info/'
|
12
12
|
option :name, "tiktok_oauth2"
|
13
13
|
option :client_options,
|
14
|
-
site: 'https://business-api.tiktok.com',
|
15
|
-
authorize_url: 'https://ads.tiktok.com/marketing_api/auth',
|
16
|
-
token_url: 'https://business-api.tiktok.com/open_api/v1.
|
14
|
+
site: 'https://business-api.tiktok.com/',
|
15
|
+
authorize_url: 'https://ads.tiktok.com/marketing_api/auth/',
|
16
|
+
token_url: 'https://business-api.tiktok.com/open_api/v1.3/oauth2/access_token/'
|
17
17
|
|
18
18
|
option :pkce, true
|
19
19
|
|
@@ -49,7 +49,7 @@ module OmniAuth
|
|
49
49
|
options.token_params.merge(
|
50
50
|
app_id: options.client_id,
|
51
51
|
secret: options.client_secret,
|
52
|
-
auth_code: request.params["
|
52
|
+
auth_code: request.params["auth_code"],
|
53
53
|
parse: :tiktok,
|
54
54
|
)
|
55
55
|
end
|
@@ -63,6 +63,17 @@ module OmniAuth
|
|
63
63
|
'Access-Token' => access_token.token,
|
64
64
|
}
|
65
65
|
end
|
66
|
+
|
67
|
+
def build_access_token
|
68
|
+
client.auth_code.get_token(
|
69
|
+
request.params['code'],
|
70
|
+
{
|
71
|
+
redirect_uri: callback_url,
|
72
|
+
headers: {'Content-Type' => 'application/json'},
|
73
|
+
}.merge(token_params.to_hash(symbolize_keys: true)),
|
74
|
+
deep_symbolize(options.auth_token_params)
|
75
|
+
)
|
76
|
+
end
|
66
77
|
end
|
67
78
|
end
|
68
79
|
end
|
@@ -12,6 +12,6 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.files = `git ls-files`.split("\n")
|
13
13
|
gem.require_paths = ['lib']
|
14
14
|
|
15
|
-
gem.add_runtime_dependency 'omniauth-oauth2', '~> 1.
|
16
|
-
gem.add_runtime_dependency 'oauth2', '
|
15
|
+
gem.add_runtime_dependency 'omniauth-oauth2', '~> 1.8'
|
16
|
+
gem.add_runtime_dependency 'oauth2', '>= 2.0.7'
|
17
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-tiktok-oauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kristoffer Ek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.8'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.8'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: oauth2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.0.7
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 2.0.7
|
41
41
|
description: A TikTok Marketing API OAuth2 strategy for OmniAuth. This allows you
|
42
42
|
to login with TikTok in your ruby app.
|
43
43
|
email:
|
@@ -72,8 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
|
-
|
76
|
-
rubygems_version: 2.7.6.2
|
75
|
+
rubygems_version: 3.2.3
|
77
76
|
signing_key:
|
78
77
|
specification_version: 4
|
79
78
|
summary: A TikTok Marketing API OAuth2 strategy for OmniAuth
|