omniauth-tiktok-loginkit 1.0.0 → 1.2.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/.rubocop.yml +5 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +8 -0
- data/README.md +10 -1
- data/lib/omniauth/strategies/tiktok_loginkit.rb +4 -1
- data/lib/omniauth-tiktok-loginkit/version.rb +1 -1
- metadata +3 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5faf04e9c367568132c0bec1556049fed6c880e3835d3c11be6c3be9cfcd60f2
|
|
4
|
+
data.tar.gz: 033cec6a5871db23ce159baef696073ab5ad432df3db1546a02a98096f4a5c28
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 20e2145990aef6b8ae406fc80e8c7d074e2a1ff397c302a0e4f79bf5a8028687cd4edf4ba647a82ae6e29951ff24c6bcfb0b28dd9f4cb4bca49a291d80664cf7
|
|
7
|
+
data.tar.gz: ad559681e8b48b5a2a86490666ed16c0bd7cf7f402762e451d967d572539f0bb68cbbb58694293ed7cf0eb96c6935c93b7b4bfc5cd82373da84252a749a8df0a
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3.4.2
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
# omniauth-tiktok-loginkit
|
|
2
2
|
|
|
3
|
+
[](https://github.com/layerssss/omniauth-tiktok-loginkit/actions/workflows/rspec.yml)
|
|
4
|
+
[](https://github.com/layerssss/omniauth-tiktok-loginkit/actions/workflows/rubocop.yml)
|
|
5
|
+
[](https://badge.fury.io/rb/omniauth-tiktok-loginkit)
|
|
6
|
+
|
|
3
7
|
OmniAuth Strategy for TikTok [LoginKit](https://developers.tiktok.com/doc/login-kit-overview/)
|
|
4
8
|
|
|
5
9
|
Using TikTok Oauth API v2.
|
|
6
10
|
|
|
7
11
|
## Config
|
|
8
12
|
|
|
13
|
+
```
|
|
14
|
+
gem "omniauth-tiktok-loginkit"
|
|
15
|
+
```
|
|
16
|
+
|
|
9
17
|
Configure with CLIENT_KEY and CLIENT_SECRET from TikTok Developers Portal (https://developers.tiktok.com/apps/). Note CLIENT_KEY is the value of "Client Key" field, not "App ID" on the portal.
|
|
10
18
|
|
|
11
19
|
TikTok requires apps to be approved by review before it can access any APIs, including the Oauth APIs. Also any configuration change to the app will cause it to be back in "Staging" status. So please configure all neccessary "Redirect URI" correctly before submitting a review.
|
|
@@ -38,9 +46,10 @@ config.omniauth(
|
|
|
38
46
|
|
|
39
47
|
## Options
|
|
40
48
|
|
|
41
|
-
* `name`: change endpoint to /auth/tiktok_another, /auth/tiktok_another/callback. default: `"
|
|
49
|
+
* `name`: change endpoint to /auth/tiktok_another, /auth/tiktok_another/callback. default: `"tiktok-loginkit"`
|
|
42
50
|
* `skip_info`: skip User Info API call to retrieve `info` hash. default: `false`
|
|
43
51
|
* `scope`: oauth scopes, seperated by comma. default: `"user.info.basic"`
|
|
52
|
+
* `redirect_uri`: change the redirect_uri used after the user authenticates with TikTok (overrides the `name` option)
|
|
44
53
|
|
|
45
54
|
|
|
46
55
|
## Usage
|
|
@@ -63,7 +63,7 @@ module OmniAuth
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def callback_url
|
|
66
|
-
full_host + callback_path
|
|
66
|
+
options[:redirect_uri] || (full_host + callback_path)
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
private
|
|
@@ -77,6 +77,9 @@ module OmniAuth
|
|
|
77
77
|
if scopes.include?("user.info.profile")
|
|
78
78
|
fields.push("profile_web_link", "profile_deep_link", "bio_description", "is_verified", "username")
|
|
79
79
|
end
|
|
80
|
+
if scopes.include?("user.info.stats")
|
|
81
|
+
fields.push("follower_count", "following_count", "likes_count", "video_count")
|
|
82
|
+
end
|
|
80
83
|
response = access_token
|
|
81
84
|
.get(
|
|
82
85
|
USER_INFO_URL,
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-tiktok-loginkit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Yin
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: oauth2
|
|
@@ -52,7 +51,6 @@ dependencies:
|
|
|
52
51
|
- - "~>"
|
|
53
52
|
- !ruby/object:Gem::Version
|
|
54
53
|
version: '1.0'
|
|
55
|
-
description:
|
|
56
54
|
email:
|
|
57
55
|
- layerssss@gmail.com
|
|
58
56
|
executables: []
|
|
@@ -76,7 +74,6 @@ metadata:
|
|
|
76
74
|
homepage_uri: https://github.com/layerssss/omniauth-tiktok-loginkit
|
|
77
75
|
source_code_uri: https://github.com/layerssss/omniauth-tiktok-loginkit
|
|
78
76
|
changelog_uri: https://github.com/layerssss/omniauth-tiktok-loginkit/blob/main/CHANGELOG.md
|
|
79
|
-
post_install_message:
|
|
80
77
|
rdoc_options: []
|
|
81
78
|
require_paths:
|
|
82
79
|
- lib
|
|
@@ -91,8 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
91
88
|
- !ruby/object:Gem::Version
|
|
92
89
|
version: '0'
|
|
93
90
|
requirements: []
|
|
94
|
-
rubygems_version: 3.
|
|
95
|
-
signing_key:
|
|
91
|
+
rubygems_version: 3.6.9
|
|
96
92
|
specification_version: 4
|
|
97
93
|
summary: OmniAuth Strategy for TikTok LoginKit
|
|
98
94
|
test_files: []
|