Authentication
To unlock the complete functionality of Deriv APIs, you must authenticate and authorise your users. Deriv supports two approaches: OAuth 2.0 apps and Personal Access Token (PAT) apps.
Authentication Methods
OAuth 2.0 apps
OAuth 2.0 lets users grant your app access without sharing their password. Your app redirects the user to a Deriv sign-in and consent page. After approval, Deriv returns an authorization code which you exchange for an access token.
PAT apps
With a PAT app, the user generates a Personal Access Token in Deriv and manually enters it into your application. The app stores the token and includes it in API requests as a bearer token.
Token-based access
Why Authentication Matters
Authentication improves security by keeping user passwords out of third-party apps. Tokens limit access based on scopes and can be revoked independently if needed.
OAuth 2.0 provides a standardized flow with short-lived access tokens to enhance security and user experience. PATs provide a simpler authentication option when manual token entry is acceptable.
OAuth 2.0 app vs PAT app
When to choose which
- Choose OAuth 2.0 app when your product can handle browser redirects and you need a standard delegated flow with user authorisation.
- Choose PAT app when browser redirects are not practical and manual token entry is acceptable, such as in desktop or native environments.
Any other questions? Get in touch