๐Ÿ“‹

Provider Setup Guide

Step-by-step instructions to register OAuth apps for each provider. Select a provider below to get started.

TW

Twitter (X)

OAuth 2.0
Callback URL
https://hasontech.vn/api/auth/callback/twitter
Scopes
tweet.readusers.readoffline.access
ApprovalRequired ยท 24-72h (Tier 0 auto for basic read)
Refresh TokenYes

Setup Steps

  1. 1Create a Twitter Developer account at developer.twitter.com
  2. 2Create a new Project in the Developer Portal
  3. 3Create an App within the project
  4. 4Enable OAuth 2.0 in the App settings under Authentication
  5. 5Set the callback URL to https://hasontech.vn/api/auth/callback/twitter
  6. 6Copy your Client ID and Client Secret from the Keys and Tokens tab

Common Errors

ErrorFix
code_challenge requiredPKCE is mandatory โ€” ensure your OAuth library sends code_challenge with every request
redirect_uri_mismatchCallback URL is case-sensitive โ€” match exactly including http vs https and trailing slashes

Important Notes

  • โ€ขNo email scope is available through Twitter's OAuth 2.0
  • โ€ขPKCE (Proof Key for Code Exchange) is mandatory for all OAuth 2.0 flows
  • โ€ขTwitter API v1.1 is deprecated โ€” use v2 endpoints only

Provider Comparison

Quick reference for all login providers.

Twitter (X)
Approval:24-72h (Tier 0 auto for basic read)Email:NoRefresh Token:YesPKCE:Yes
LinkedIn
Approval:Light review, 1-2hEmail:YesRefresh Token:NoPKCE:No
Reddit
Approval:InstantEmail:NoRefresh Token:YesPKCE:No
TikTok
Approval:3-5 business days (mandatory review)Email:YesRefresh Token:YesPKCE:No
VKontakte
Approval:InstantEmail:YesRefresh Token:NoPKCE:No
Mastodon
Approval:InstantEmail:NoRefresh Token:NoPKCE:No
LINE
Approval:InstantEmail:YesRefresh Token:YesPKCE:No

Credentials go in your .env file โ€” never commit them to version control.