Security Best Practices
Server-side Validation
Always validate
redirect_uri
server-side against a whitelistVerify the
state
parameter matches the original request
Authorization Flow
Use authorization code flow (
response_type=code
)Avoid implicit flow (
response_type=token
)Implement PKCE when possible
Token Management
Store tokens securely
Refresh tokens before expiration
Validate scope parameters for each application
Request Security
Use HTTPS for all API calls
Include proper headers and origins
Handle errors and token expiration gracefully
Last updated