atinux / nuxt-auth-utils

Add Authentication to Nuxt applications with secured & sealed cookies sessions.
MIT License
974 stars 91 forks source link

feat: add `tiktok` provider #153

Closed ahmedrangel closed 2 months ago

ahmedrangel commented 2 months ago

For testing follow these steps:

  1. Sign up at https://developers.tiktok.com/signup
  2. Go to Developer Portal https://developers.tiktok.com/apps
  3. Click Connect an app, then select "An individual developer", enter an app name, click Confirm
  4. Click Sandbox
  5. Click Create Sandbox
  6. Enter a sandbox name, click Confirm
  7. Fill all the required fields
  8. In Platforms select Desktop and write http://127.0.0.1:3000
  9. In Products, click Add products and add Login Kit
  10. In Login Kit: Redirect URI select Dektop and add http://127.0.0.1:3000/auth/tiktok
  11. In Sandbox settings: Target Users, connect your TikTok account
  12. Apply Changes
  13. Copy your Client key and Client secret
  14. Add to .env NUXT_OAUTH_TIKTOK_CLIENT_KEY and NUXT_OAUTH_TIKTOK_CLIENT_SECRET
  15. Test tiktok auth

image

atinux commented 2 months ago

Thanks for the PR @ahmedrangel

Would you mind updating your code to use the new utils from https://github.com/atinux/nuxt-auth-utils/pull/147 ?

ahmedrangel commented 2 months ago

Thanks for the PR @ahmedrangel

Would you mind updating your code to use the new utils from #147 ?

Done!

Btw, I had to extend RequestAccessTokenBody because TikTok's access token request parameters include additional parameters like client_key and code_verifier from those specified in RFC 6749 Section 4.1.3

atinux commented 2 months ago

Your pull request is was I expect from contributors ❤️

Thank you for detailing all the steps, updating the readme and everyting!