Custom Provider for TikTok Error - access_token not present in TokenSet #5675
Unanswered
thomasefbland
asked this question in
Help
Replies: 3 comments 7 replies
-
Normally this issue would come up if you have SECRET and callback URL settings incorrectly. See similar issue: #4266 (comment) |
Beta Was this translation helpful? Give feedback.
3 replies
-
i had the same problem some months ago, when i was developing a client for tiktok loginkit, it's a nightmare to develop on localhost. The only solution to this to make it work on localhost was using a chrome extension: Requestly . The extension acts as a "middleware" and redirects the domain to localhost. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Provider type
Custom provider
Environment
System:
OS: macOS 12.6
CPU: (10) arm64 Apple M1 Pro
Memory: 221.34 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.10.0 - /opt/homebrew/bin/node
npm: 8.19.2 - /opt/homebrew/bin/npm
Browsers:
Brave Browser: 105.1.43.89
Safari: 16.0
npmPackages:
next: 12.3.1 => 12.3.1
next-auth: ^4.13.0 => 4.13.0
react: 18.2.0 => 18.2.0
Describe the issue
To start off, troubleshooting this is a bit of a nightmare to be frank. TikTok does not allow localhost as a redirect url, so I've been testing this portion of functionality purely on the vercel deployment. The problem presents when logging in through TikTok, where after redirecting from the authorization portion it appears to fail. That is at least my presumption, as the url is /api/auth/signin?error=OAuthCallback
This is the nextauth.ts file
And this is the relevant function log from the vercel deployment. Again, I cannot test this with localhost
How to reproduce
Clone the repo and deploy on vercel. Admittedly, this may be a challenge to test, as acquiring a tiktok developer key is quite a process. If you are able to do this, simply navigate to the homepage and press login.
I also have the relevant environment variables set on Vercel, so that is not the cause of the issue.
Expected behavior
My expectation would be that, at the minimum, it would fail on the userinfo stage of the process. Perhaps it is and I am misdiagnosing the problem. The tiktok api is a bit bare and strange, but I did expect to be able to get past the requesting access and refresh token stage. Of course ideally, it would function all the way to completion of a sign-in.
Beta Was this translation helpful? Give feedback.
All reactions